0

I currently have my Greenplum database installed and running on a server. I have attached a new hard disk and have simply copied the master directory and all of the segment directories over because I want to point my database to the data on the new hard disk.

I have changed the environment variable MASTER_DATA_DIRECTORY to point to the new master directory, however I cannot figure out how to point to the new segment data directories. How can I point to the new directories so that when I run gpstart, my database starts up pointing to the data on the new hardware?

Thanks

McLovin
  • 1,455
  • 3
  • 19
  • 37

1 Answers1

3

Out of the box Greenplum does not support moving its directories. But it can be done this way:

  1. Move the directories and in their old locations create symbolic links to the new locations. For instance, if previously you used "/data/master" directory and switched to "/data2/master" you can easily remove "/data/master" directory and replace it with symbolic link "/data/master -> /data2/master"
  2. More complicated and not recommended approach. Greenplum stores filespace locations in pg_filespace_entry table. You should start the Greenplum in restricted mode, edit this table ("set allow_system_table_mods=DML; update pg_filespace_entry set ..."), stop the Greenplum (the stop might fail, you should manually stop each segment with "pg_ctl -D stop"), move the directories

Regardless of the approaches, you should backup the DB. If this is test environment, I'd recommend you to just remove the old system with "gpdeletesystem" and init it anew in new directories

0x0FFF
  • 4,948
  • 3
  • 20
  • 26