mxinitstandby

This document describes the mxinitstandby tool, which is used to add or remove a Standby node in a YMatrix database system.

Note!
The mxinitstandby command must be executed by a user with sudo privileges on the Master host (except for mxadmin), and must use the full absolute path: /opt/ymatrix/matrixdb6/bin/mxinitstandby.

1 Description

Initializes or removes a Standby node in a YMatrix database system.

2 Command-Line Options

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

Subcommand Option Description Required?
init Collects system information and generates a basic initialization plan.
--db-cluster-id Specifies the database cluster ID to identify a unique cluster. Optional
--host Hostname of the machine where the Standby node will be added. Required
--port Starting port number to search for an available port for Standby; defaults to searching from 5432. Optional
plan Generates a deployment plan based on collected information.
--init-file Absolute path to the file containing output from the init command. Required
setup Executes the deployment plan.
--plan-file Absolute path to the file containing output from the plan command. Required
-r Flag indicating removal mode for deleting a Standby node. Required

3 Usage Examples

3.1 Add or Initialize a Standby Node

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

Example workflow for adding a Standby node:

  1. Collect host information and partial configuration of the existing database cluster:

    $ mxinitstandby init --host <standby_hostname> > /tmp/mxinitstandby.init

    Note!
    Replace <host> with the actual hostname.

  2. Generate a deployment plan using the collected data:

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

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

    Note!
    If you accidentally run the mxinitstandby init command without sudo privileges, the mxinitstandby.init file will be created under that user's context, making it readable but not writable by others. You must delete this file and re-run the command as a user with sudo privileges to regenerate it correctly.

3.2 Remove a Standby Node

Note!
You must complete the full Standby node removal process as described below.

Example workflow for removing a Standby node:

  1. Collect information required for removal:

    $ mxinitstandby -r init > /tmp/mxinitstandby_remove.init
  2. Generate a removal plan:

    $ mxinitstandby -r plan --init-file /tmp/mxinitstandby_remove.init > /tmp/mxinitstandby_remove.plan
  3. Execute the removal:

    $ mxinitstandby -r setup --plan-file /tmp/mxinitstandby_remove.plan

    Note!
    Removing a Standby node automatically cleans up associated configuration files and data directories.
    The operation stops the Standby service and removes the node from the cluster configuration.


Note!
Starting with YMatrix 5.X, a new database architecture has been introduced. The mxinitstandby tool is now used to manage Standby nodes and is not compatible with the older gpinitstandby utility. For earlier versions, use gpinitstandby.

See Also: mxaddmirrors, mxdeletesystem