Hello, I’m DocuDroid!
Submitting feedback
Thank you for rating our AI Search!
We would be grateful if you could share your thoughts so we can improve our AI Search for you and other readers.
GitHub

gpinitstandby

Adds and/or initializes a standby master host for a Greengage DB system.

Synopsis

gpinitstandby { -s <standby_hostname> [ -P <port> ] | -r | -n }
              [ -a ]
              [ -q ]
              [ -D ]
              [ -S <standby_data_directory> ]
              [ -l <logfile_directory> ]
              [ --hba-hostnames ]

gpinitstandby -v

gpinitstandby -?

Description

The gpinitstandby utility adds a backup, standby master instance to your Greengage DB system. If your system has an existing standby master instance configured, use the -r option to remove it before adding the new standby master instance.

Before running this utility, make sure that the Greengage DB software is installed on the standby master host and that you have exchanged SSH keys between the hosts. It is recommended that the master port is set to the same port number on the master host and the standby master host.

This utility should be run on the currently active primary master host.

The utility performs the following steps:

  • Updates the Greengage DB system catalog to remove the existing standby master information (if the -r option is supplied).

  • Updates the Greengage DB system catalog to add the new standby master instance information.

  • Edits the pg_hba.conf file of the Greengage DB master to allow access from the newly added standby master.

  • Sets up the standby master instance on the alternate master host.

  • Starts the synchronization process.

A backup, standby master instance serves as a warm standby in the event of the primary master becoming non-operational. The standby master is kept up to date by transaction log replication processes (walsender and walreceiver), which run on the primary master and standby master hosts and keep the data between the primary and standby master instances synchronized. If the primary master fails, the log replication process shuts down, and the standby master can be activated in its place by using the gpactivatestandby utility. Upon activation of the standby master, the replicated logs are used to reconstruct the state of the master instance at the time of the last successfully committed transaction.

The activated standby master effectively becomes the Greengage DB master, accepting client connections on the master port and performing normal master operations such as SQL command processing and resource management.

IMPORTANT

If the gpinitstandby utility previously failed to initialize the standby master, you must delete the files in the standby master data directory before running gpinitstandby again. The standby master data directory is not cleaned up after an initialization failure because it contains log files that can help in determining the reason for the failure.

If an initialization failure occurs, a summary report file is generated in the standby host directory /tmp. The report file lists the directories on the standby host that require clean up.

Options

-a

Do not prompt the user for confirmation.

-D

Set logging level to debug.

--hba-hostnames

(Optional) Whether to use IP addresses or host names in the pg_hba.conf file when updating this file with addresses that can connect to Greengage DB. By default, the utility uses IP addresses when updating this file. For consistency, use the same value that was specified for HBA_HOSTNAMES when the Greengage DB system was initialized.

-l <logfile_directory>

The directory to write the log file. Defaults to ~/gpAdminLogs.

-n

Specify this option to start a Greengage DB standby master that has been configured but has stopped for some reason.

-P <port>

Specify the port that is used by the Greengage DB standby master. The default is the same port as the active Greengage DB master.

If the Greengage DB standby master is on the same host as the active master, the ports must be different. If the ports are the same for the active and standby master and the host is the same, the utility returns an error.

-q

Run in quiet mode. Command output is not displayed on the screen, but is still written to the log file.

-r

Remove the currently configured standby master instance from your Greengage DB system.

-s <standby_hostname>

The host name of the standby master host.

-S <standby_data_directory>

The data directory to use for a new standby master. The default is the same directory used by the active master.

If the standby master is on the same host as the active master, a different directory must be specified using this option.

-v

Display the version, status, last updated date, and checksum of this utility.

-?

Display help.

Examples

Add a standby master instance to your Greengage DB system and start the synchronization process:

$ gpinitstandby -s smdw

Start an existing standby master instance and synchronize the data with the current primary master instance:

$ gpinitstandby -n
NOTE

Do not specify the -n and -s options in the same command.

Add a standby master instance to your Greengage DB system specifying a different port:

$ gpinitstandby -s smdw -P 12000

If you specify the same host name as the active Greengage DB master, you must also specify a different port number with the -P option and a standby data directory with the -S option.

Remove the existing standby master from your Greengage DB system configuration:

$ gpinitstandby -r

See also