Activating standby master when primary master goes down

posted Apr 28, 2017, 12:22 PM by Sachchida Ojha
1. When primary master fails, log replication stops.  
2. gpactivatestandby command is used to activate the standby master. Upon activation of the standby master, Greenplum Database reconstructs the master host state at the time of the last successfully committed transaction.

To activate the standby master
1.Ensure a standby master host is configured for the system. 

2.Run the gpactivatestandby utility from the standby master host you are activating. For example:
$ gpactivatestandby -d /data/master/gpseg-1
Where -d specifies the data directory of the master host you are activating.
After you activate the standby, it becomes the active or primary master for your Greenplum Database array.

3.After the utility finishes, run gpstate to check the status:
$ gpstate -f
The newly activated master’s status should be Active. If you configured a new standby host, its status is Passive. If not configured, its status is Not Configured.

4.After switching to the newly active master host, run ANALYZE on it. For example:
$ psql dbname -c 'ANALYZE;'

5.Optional: If you did not specify a new standby host when running the gpactivatestandby utility, use gpinitstandby to configure a new standby master at a later time. Run gpinitstandby on your active master host. For example:
$ gpinitstandby -s new_standby_master_hostname

Comments