Pivotal Knowledge Base


How to change Pivotal HDB (HAWQ) master port once database has been initialized ?

In case you wish to change Pivotal HDB (HAWQ) master port after the HDB database has already been initialized, please follow the below steps.

  1. Stop the database : gpstop -af
  2. Start the database in master-only mode : gpstart -m

  3. Create a utility connection : PGOPTIONS='-c gp_session_role=utility' psql

    gpadmin=#  set allow_system_table_mods=dml;
    gpadmin=#  UPDATE pg_catalog.gp_segment_configuration SET port=XXXX WHERE  content = -1;

    where XXXX is the new port to be used

  4. Verify the change in catalog :

    gpadmin=# select hostname,port from gp_segment_configuration;

  5. Stop the database : gpstop -m

  6. Edit postgresql.conf file under MASTER_DATA_DIRECTORY and update PGPORT=xxxx, where xxxx is the port number on which you want to run HAWQ master

  7. Start the database : gpstart -a

Note: While initializing HDB, you may change the value for variable MASTER_PORT=xxxx in the configuration file (ex. /etc/gphd/hawq/conf/gpinitsystem_config). By default, it's 5432.


Powered by Zendesk