Quick onboard
Deployment
Data Modeling
Connecting
Migration
Query
Operations and Maintenance
Common Maintenance
Partition
Backup and Restore
Expansion
Mirroring
Resource Management
Security
Monitoring
Performance Tuning
Troubleshooting
Reference Guide
Tool guide
Data type
Storage Engine
Executor
Stream
DR (Disaster Recovery)
Configuration
Index
Extension
SQL Reference
This document describes the mxinitstandby tool, which is used to add or remove a Standby node in a YMatrix database system.
Note!
Themxinitstandbycommand 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.
Initializes or removes a Standby node in a YMatrix database system.
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 |
Note!
You must complete the entire Standby node addition process as described below.
Example workflow for adding a Standby node:
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.
Generate a deployment plan using the collected data:
$ mxinitstandby plan --init-file /tmp/mxinitstandby.init > /tmp/mxinitstandby.plan
Execute the deployment:
$ mxinitstandby setup --plan-file /tmp/mxinitstandby.plan --mode cli
Note!
If you accidentally run themxinitstandby initcommand without sudo privileges, themxinitstandby.initfile 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.
Note!
You must complete the full Standby node removal process as described below.
Example workflow for removing a Standby node:
Collect information required for removal:
$ mxinitstandby -r init > /tmp/mxinitstandby_remove.init
Generate a removal plan:
$ mxinitstandby -r plan --init-file /tmp/mxinitstandby_remove.init > /tmp/mxinitstandby_remove.plan
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. Themxinitstandbytool is now used to manage Standby nodes and is not compatible with the oldergpinitstandbyutility. For earlier versions, usegpinitstandby.