Initializing the Database
The initialization of the Greenplum database includes key operations such as host name change, environment configuration, SSH key exchange, and initialization using the gpinitsystem tool.
If the default hostname localhost is used, an error will be reported when you perform step 5. In the following example, the hostname is master. In actual operations, use the hostname you set.
- Optional: If Greenplum is installed by using an RPM package from the mirror site, perform the following steps to prevent database initialization errors:
- Configure the local yum source. For details, see Configuring the Yum Source in the Greenplum Porting Guide.
- Install the dependency package.
1yum -y install net-tools
- Load the dynamic library.
1 2
echo /usr/local/lib >/etc/ld.so.conf ldconfig
- Change the hostname to master.
1 2
hostname master echo master > /etc/hostname
Exit the SSH terminal.
logout
Log in to the SSH terminal again for the new hostname to take effect.
- Add the map of the hostname to /etc/hosts on the local PC. The IP address 192.168.202.206 and hostname master are used as examples. Replace them with the actual ones.
1echo 192.168.202.206 master >>/etc/hosts
- Switch to the gpadmin user.
1su - gpadmin
- Configure mutual trust between cluster nodes.
Exchange the SSH keys of all nodes in the cluster. In this example, there is only one node. In the command, master is only an example of the hostname.
1gpssh-exkeys -h 'master'

- Exit user gpadmin and switch to user root.
1exit - Create a cluster host configuration file.
The configuration file hostfile contains all hostnames of the cluster. In this example, there is only one host. In the command, master is only an example of the hostname.
echo master >> /data/gpdb/hostfile
- Switch to the gpadmin user.
1su - gpadmin
- Create an initialization configuration file init.config.
- Open the file.
1vim /home/gpadmin/init.config - Press i to enter the insert mode and add the following content to the file:
ARRAY_NAME="Greenplum Cluster" SEG_PREFIX=gpseg #Prefix name of the segment database PORT_BASE=40000 #Start port number of the segment database declare -a DATA_DIRECTORY=(/data/gpdb/segdata /data/gpdb/segdata) #segments data directory. The number of segments started on each node is the same as the number of data directories. In this example, there are two segments. MASTER_HOSTNAME=master #Hostname of the master node MASTER_DIRECTORY=/data/gpdb/master #master data directory MASTER_PORT=5432 #master port number, which is also the port number for external services. TRUSTED_SHELL=ssh CHECK_POINT_SEGMENTS=8 ENCODING=UNICODE DATABASE_NAME=gpdb MACHINE_LIST_FILE=/data/gpdb/hostfile #Cluster configuration file. hostfile indicates the name of the file created in 7.
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the file.
- Initialize the database.
1gpinitsystem -c /home/gpadmin/init.config -a
init.config indicates the name of the file created in 9.