Configuring Environment Variables
After the Greenplum database is installed, add the path of the GPDB binary file to the system environment variable PATH so that you can run the GPDB binary file in any directory.
- Add the path of the GPDB binary file to the system environment variable PATH.
- Open the file.
1vim /home/gpadmin/.bash_profile - Press i to enter the insert mode and add the following content to the end of the file:
source /usr/local/gpdb/greenplum_path.sh export PGPORT=5432 export MASTER_DATA_DIRECTORY=/data/gpdb/master/gpseg-1
- The source /usr/local/gpdb/greenplum_path.sh command is used to import the greenplum_path.sh script. This script is used to set environment variables such as GPHOME (for setting the Greenplum home directory) and LD_LIBRARY_PATH (for setting the search path of the dynamic link library).
- export PGPORT sets the default port number of Greenplum.
- MASTER_DATA_DIRECTORY sets the data directory of the Greenplum master node. is used as an example.
See the following figure for the added content:

- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the file.
- Make the modified environment variables take effect.
1source /home/gpadmin/.bash_profile
Parent topic: Running Greenplum