Describes how to create the directory locations where WarehousePG data is stored for each coordinator, standby, and segment instance.
Parent topic: Installing and Upgrading WarehousePG
Creating Data Storage Areas on the Coordinator and Standby Coordinator Hosts
A data storage area is required on the WarehousePG coordinator and standby coordinator hosts to store WarehousePG cluster data such as catalog data and other system metadata.
To create the data directory location on the coordinator
The data directory location on the coordinator is different than those on the segments. The coordinator does not store any user data, only the system catalog tables and system metadata are stored on the coordinator instance, therefore you do not need to designate as much storage space as on the segments.
Create or choose a directory that will serve as your coordinator data storage area. This directory should have sufficient disk space for your data and be owned by the
gpadminuser and group. For example, run the following command usingsudo:sudo mkdir -p /data/coordinator
Change ownership of this directory, and any parent directories you created, to the
gpadminuser. For example:sudo chown gpadmin:gpadmin /data sudo chown -R gpadmin:gpadmin /data/coordinator
As the
gpadminuser, use gpssh to create the coordinator data directory location on your standby coordinator as well. For example:gpssh -h scdw -e 'sudo mkdir -p /data/coordinator' gpssh -h scdw -e 'sudo chown -R gpadmin:gpadmin /data/coordinator'
Creating Data Storage Areas on Segment Hosts
Data storage areas are required on the WarehousePG segment hosts for primary segments. Separate storage areas are required for mirror segments.
To create the data directory locations on all segment hosts
On the coordinator host, switch to the
gpadminuser and source thegreenplum_path.shfile.sudo -iu gpadmin source /usr/local/whpg/greenplum_path.sh
Note
Logging in as
rootwithsufails on hosts where root login is deactivated, such as Amazon EC2 instances. Usesudofor thegpsshcommands on the remote hosts instead, so you can run them asgpadmin, providedgpadminhassudoprivilege as described in Creating the WarehousePG Administrative User.Create a file called
hostfile_gpssh_segonly. This file should have only one machine configured host name for each segment host. For example, if you have three segment hosts:sdw1 sdw2 sdw3
Using gpssh, create the primary and mirror data directory locations on all segment hosts at once using the
hostfile_gpssh_segonlyfile you just created. For example:gpssh -f hostfile_gpssh_segonly -e 'sudo mkdir -p /data1/primary' gpssh -f hostfile_gpssh_segonly -e 'sudo mkdir -p /data2/primary' gpssh -f hostfile_gpssh_segonly -e 'sudo mkdir -p /data1/mirror' gpssh -f hostfile_gpssh_segonly -e 'sudo mkdir -p /data2/mirror' gpssh -f hostfile_gpssh_segonly -e 'sudo chown -R gpadmin:gpadmin /data1 /data2'
Caution
Use
chown -R gpadmin:gpadmin /data1 /data2rather thanchown -R gpadmin /data*/*. The latter sets only the owner, not the group, so the primary and mirror directories stay in therootgroup. Setting both the owner and group togpadminavoids permission problems later.