Creating the Data Storage Areas

Creating the Data Storage Areas

Describes how to create the directory locations where Greenplum Database data is stored for each master, standby, and segment instance.

Parent topic: Installing and Upgrading Greenplum

Creating Data Storage Areas on the Master and Standby Master Hosts

A data storage area is required on the Greenplum Database master and standby master hosts to store Greenplum Database system data such as catalog data and other system metadata.

To create the data directory location on the master

The data directory location on the master is different than those on the segments. The master does not store any user data, only the system catalog tables and system metadata are stored on the master instance, therefore you do not need to designate as much storage space as on the segments.

  1. Create or choose a directory that will serve as your master data storage area. This directory should have sufficient disk space for your data and be owned by the gpadmin user and group. For example, run the following commands as root:

    1. # mkdir -p /data/master
  2. Change ownership of this directory to the gpadmin user. For example:

    1. # chown gpadmin:gpadmin /data/master
  3. Using gpssh, create the master data directory location on your standby master as well. For example:

    1. # source /usr/local/greenplum-db/greenplum_path.sh
    2. # gpssh -h smdw -e 'mkdir -p /data/master'
    3. # gpssh -h smdw -e 'chown gpadmin:gpadmin /data/master'

Creating Data Storage Areas on Segment Hosts

Data storage areas are required on the Greenplum Database segment hosts for primary segments. Separate storage areas are required for mirror segments.

To create the data directory locations on all segment hosts

  1. On the master host, log in as root:

    1. # su
  2. 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:

    1. sdw1
    2. sdw2
    3. sdw3
  3. Using gpssh, create the primary and mirror data directory locations on all segment hosts at once using the hostfile_gpssh_segonly file you just created. For example:

    1. # source /usr/local/greenplum-db/greenplum_path.sh
    2. # gpssh -f hostfile_gpssh_segonly -e 'mkdir -p /data/primary'
    3. # gpssh -f hostfile_gpssh_segonly -e 'mkdir -p /data/mirror'
    4. # gpssh -f hostfile_gpssh_segonly -e 'chown -R gpadmin /data/*'

Next Steps