mxinitstandby

This document describes the mxinitstandby tool, which is used to add or initialize a standby Master instance in a YMatrix database system.

1 Description

Adds or initializes a Standby Master in the YMatrix database system.

2 Command-Line Options

The following table provides detailed information about the command-line options:

Subcommand Option Description Optional
init Converts collected information into a basic plan
--db-cluster-id Database cluster ID. Used to identify a unique database cluster Optional
--host Host on which to add the Standby Master Required
--port Starting port from which to search for an available port for Standby Master listening. Default starts from 5432 Optional
plan Generates a deployment plan
--init-file Absolute path to the redirected output file from the init command Required
setup Executes the deployment
--plan-file Absolute path to the redirected output file from the plan command Required

3 Usage Example

mxinitstandby must be executed by a user with sudo privileges on the Master host (except mxadmin, use absolute path /opt/ymatrix/matrixdb5/bin/mxinitstandby). If the mxinitstandby init command is mistakenly run under a non-sudo user, a mxinitstandby.init file will be generated under that user's context, readable but not writable by other users. In such cases, delete the generated file and re-run the command under a sudo-enabled user to regenerate it.

Below is an example workflow:

Note!
You must complete the entire Standby Master addition process as described below.

  1. Collect host information and partial deployment details of the existing database.
    $ mxinitstandby init --host <standby_hostname> > /tmp/mxinitstandby.init

Note!
Replace <host> with the actual hostname.

  1. Generate a deployment plan based on the collected information, outlining specific deployment steps.

    $ mxinitstandby plan --init-file /tmp/mxinitstandby.init > /tmp/mxinitstandby.plan
  2. Execute the deployment.

    $ mxinitstandby setup --plan-file /tmp/mxinitstandby.plan --mode cli

Note!
YMatrix 5 introduces a new database architecture. Use the mxinitstandby tool to add a Standby Master. It is not compatible with gpinitstandby. Earlier versions may use gpinitstandby.

See Also: mxaddmirrors, mxdeletesystem