Initializing Greenplum
Before initializing the Greenplum database, modify the parameters in the initialization configuration file and then run the initialization command. Perform the operations in this section on the master node.
To initialize Greenplum, perform the following steps:
- Open the initialization configuration file /home/gpadmin/init.config.
vim /home/gpadmin/init.config
- Press i to enter the insert mode and add the following content:
ARRAY_NAME="Greenplum Cluster" SEG_PREFIX=gpseg PORT_BASE=40000 declare -a DATA_DIRECTORY=(/data/gpdb/segdata /data/gpdb/segdata) MASTER_HOSTNAME=gp-mdw MASTER_DIRECTORY=/data/gpdb/master MASTER_PORT=5432 TRUSTED_SHELL=ssh CHECK_POINT_SEGMENTS=8 ENCODING=UNICODE DATABASE_NAME=gpdb MACHINE_LIST_FILE=/data/gpdb/seg_hosts
Table 1 Parameters in the configuration file Parameter
Description
ARRAY_NAME
Sets the name of the Greenplum cluster.
SEG_PREFIX
Sets the prefix name of the segment database.
PORT_BASE
Sets the start port number of the segment database.
DATA_DIRECTORY
Defines the array of the segment data directory. Greenplum starts a segment in each data directory.
MASTER_HOSTNAME
Specifies the host name of the master node.
MASTER_DIRECTORY
Specifies the data directory of the master node.
MASTER_PORT
Specifies the port number of the master node. This port is usually used by services.
TRUSTED_SHELL
Sets the value to ssh, which means SSH is used for communication between nodes during initialization.
CHECK_POINT_SEGMENTS
Specifies the number of segments to be written at checkpoints.
ENCODING
Sets the character encoding of the database. UNICODE is used.
DATABASE_NAME
Specifies the name of the database to be created after initialization.
MACHINE_LIST_FILE
Specifies the path of the configuration file that contains information about all hosts in the cluster.
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Initialize the database.
gpinitsystem -c /home/gpadmin/init.config -a