mxinitstandby

This document introduces mxinitstandby, a tool for adding and removing standby nodes.

Notes!
mxinitstandby must be executed by a user with sudo privileges on the master node (except for mxadmin, which requires the absolute path /opt/ymatrix/matrixdb6/bin/mxinitstandby).

1 Description

Initializes, initializes, or removes Standby nodes for the YMatrix database system.

2 Command-line parameter information

The following is a detailed introduction to the command-line parameters:

Subcommand Parameter name Description Optional
init Convert the collected information into a basic plan
--db-cluster-id Database cluster ID. Used to identify a unique database cluster Optional
--host Add the host for the Standby Required
--port Search for an available port starting from the current port as the Standby listening port, defaulting to 5432 Optional
plan Generate deployment plan
--init-file Absolute path of the redirect file containing the output of the init command Required
setup Execute deployment
--plan-file Absolute path of the file that redirects the output of the plan command Required
-r Identifier parameter for deleting Standby nodes Required

3 Example of usage process

3.1 Add or initialize

Notes!
You need to perform the following complete Standby addition process.

Here is an example of the Standby node addition process. The details are as follows:

  1. Collect machine information and some information about the deployed database.

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

    Note!
    Please replace <host> with the corresponding host name.

  2. Generate a deployment plan based on the collected information, i.e., the specific deployment steps.

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

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

    Notes!
    If you mistakenly execute the mxinitstandby init command on a user without sudo privileges, the mxinitstandby.init file will be generated under that user, and other users will only be able to read it but not write to it. You need to delete the generated file and re-execute the command on a user with sudo privileges to regenerate the file.

3.2 Delete or remove

Notes!
You need to perform the following complete Standby deletion process.

Here is an example of the Standby node deletion process:

  1. Collect deletion information and partial information about the deployed database.
    $ mxinitstandby -r init > /tmp/mxinitstandby_remove.init
  2. Generate a deletion plan based on the collected information, i.e., the specific deletion steps.
    $ mxinitstandby -r plan --init-file /tmp/mxinitstandby_remove.init > /tmp/mxinitstandby_remove.plan
  3. Execute the deletion.
    $ mxinitstandby -r setup --plan-file /tmp/mxinitstandby_remove.plan 

    Notes!
    Deleting the Standby node will automatically clean up the relevant configuration and data files.
    The deletion operation will stop the Standby node service and remove the node from the cluster configuration.


Note!
Starting with YMatrix 5.X, a new database architecture has been deployed, enabling the mxinitstandby tool to manage Standby, which is incompatible with gpinitstandby. Previous versions can use the gpinitstandby tool.

See also: mxaddmirrors, mxdeletesystem.