【Manager Handbook for Distributed AntDB-T】Node Management Related Commands (1): Init All, Monitor, and Start,
Node management related commands
The node management of AntDB cluster mainly includes start, stop, monitoring, initialization, clearance and other operations, and the cooresponding operation commands are start, stop, monitor, init and clean. The functions and usage of these commands are explained in detail below.
init all
Command function:
Initializes the entire AntDB cluster. adbmgr does not provide commands to initialize individual nodes, but only provides commands to initialize the whole cluster. You can initialize and start the whole cluster by adding the host and node information required by the ADB cluster to the host and node tables, and then just execute the init all command. The specific functions can be viewed through the help command \h init all.
Command format:
INIT ALL
INIT ALL (walsegsize=64)
walsegsize=64: the unit of 64 is MB, and the value of walsegsize must be a power of 2 between 1 and 1024.
Command example:
-- After configuring the host table and node table, initialize the entire cluster:
INIT ALL;
-- Initialize the cluster and execute walsegsize as 512MB:
INIT ALL(walsegsize=512);
monitor
Command function:
View the operational status of a specified node name or a specified node type in an AntDB cluster. The Monitor command returns two kinds of values.
running: means the node is running and accepting new connections; not running: means the node is not running.
The specific function can be viewed by the help command \h monitor.
Command format:
View the running status of the node
MONITOR [ ALL ]
MONITOR GTMCOORD [ ALL ]
MONITOR GTMCOORD { MASTER | SLAVE } [ ALL | node_name ]
MONITOR COORDINATOR { MASTER | SLAVE } [ ALL | node_name [, ...] ]
MONITOR DATANODE [ ALL ]
MONITOR DATANODE { MASTER | SLAVE } [ ALL | node_name [, ...] ]
MONITOR ZONE zonename
View the operational status of the agent
MONITOR AGENT [ ALL | host_name [, ...] ]
View the status of primary and secondary stream replication
MONITOR HA
MONITOR HA [ ( option ) ] [ node_name [, ...] ]
MONITOR HA ZONE zonename
Command example:
-- View the current running status of all nodes in the ADB cluster:
MONITOR ALL;
-- View the current running status of all coordinator nodes in the cluster:
MONITOR COORDINATOR ALL;
-- View the current running status of the nodes in the cluster with node type datanode master and node names db1 and db2:
MONITOR DATANODE MASTER db1,db2;
-- View the status of the cluster agent:
MONITOR agent ;
-- View the stream replication status of the cluster:
MONITOR ha;
start
Command function:
Starts a cluster node with the specified node name, or starts all cluster nodes of the specified node type. The specific functions can be viewed through the help command \h start.
Command format:
Start the nodes in the cluster:
START ALL
START GTMCOORD ALL
START GTMCOORD { MASTER | SLAVE } node_name
START COORDINATOR [ MASTER | SLAVE ] ALL
START COORDINATOR { MASTER | SLAVE } node_name [, ...]
START DATANODE ALL
START DATANODE { MASTER | SLAVE } { ALL | node_name [, ...] }
START ZONE zonename
Start agent:
START AGENT { ALL | host_name [, ...] } [ PASSWORD passwd ]
Command example:
-- Start all nodes in the cluster:
START ALL;
-- Start the gtmcoord master node:
START GTMCOORD MASTER gc;
-- Start the nodes in the current cluster with node type datanode master and names db1 and db2:
START DATANODE MASTER db1,db2;
-- Start the agent on the host in the cluster:
START AGENT all;