Changing the Master Port (5432) in Greenplum

Changing the Master Port

Greenplum Database comes configured with the default master port of 5432. You should follow this process to change the master port number. Perform these steps on your Greenplum master host.

To demonstrate how to change the port, Let's change master port from 5432 to 55432.

1.Shut down your Greenplum system in fast mode, interrupting and rolling back any active transactions. There cannot be active queries in the system when the system configuration is being altered (master only).

gpcmdr --stop

gpstop -M fast

2. Backup and Edit the postgresql.conf file on BOTH the master and standby servers. 

cd $MASTER_DATA_DIRECTORY

cp postgresql.conf postgresql.conf.<data>

vi postgresql.conf

** Change the port parameter from 5432 to 55432 and then save the file.

3. Update .pgpass in /home/gpadmin with the new port on BOTH the master and standby servers.

cd /home/gpadmin

cp .pgpass .pgpass.<date>

vi .pgpass

** Change 5432 to 55432 and then save the file


4. Update gpperfmonui.conf with the new port on BOTH the master and standby servers.

cd $GPPERFMONHOME/instances/gpperfmon/conf

cp gpperfmonui.conf gpperfmonui.conf.<date>

vi gpperfmonui.conf

** Change :5432: to :55432: and then save the file

4. Backup and then add export PGPORT=55432 to the end of the following environment scripts on BOTH the master and standby servers.

.

/home/gpadmin/.bash_profile

/usr/local/greenplum-db/greenplum_path.sh

5. Restart your Greenplum Database system (master only). 

gpstart

6. Start a psql client session using the new port and edit the gp_segment_configuration system catalog to change the master port (master only).

psql -p 55432

set allow_system_table_mods='dml';

UPDATE gp_segment_configuration SET port=55432 WHERE port=5432

set allow_system_table_mods='none';

\q

7. Start command center (master only)

gpcmdr --start

8. Update client programs (pgadmin III, Informatica, etc.) so that they connect to the new master port.