DEV Community

AntDB
AntDB

Posted on • Updated on

Manager Handbook for Distributed AntDB-T - P4

list node


Command function:

Display the node information in the node table. The specific function can be viewed by the help command “\h list node”.

Command format:

LIST NODE COORDINATOR [ MASTER | SLAVE ] 
LIST NODE DATANODE [ MASTER | SLAVE ] 
LIST NODE DATANODE MASTER node_name 
LIST NODE HOST host_name [, ...] 
LIST NODE  [ ( option ) ] [ node_name [, ...] ] 
LIST NODE ZONE zonename 
where option can be one of: 

    NAME 
    HOST 
    TYPE 
    MASTERNAME 
    PORT 
    SYNC_STATE 
    PATH 
    INITIALIZED 
    INCLUSTER 

Parameter Description: 
NAMENode name, corresponding to the name column of the node table. 
HOSTThe hostname, corresponding to the hostname in the host table. 
TYPENode type, including: GTMCOORD MASTER GTMCOORD SLAVECOORDINATOR MASTERDATANODE  MASTERDATANODE SLAVE 
MASTERNAMEThe hostname corresponding to the standby machine; the non-standby machine corresponds to null. 
PORTThe port number that the agent process listens on.  
sync_stateThe synchronous/asynchronous relationship between slave node and master node. Only valid for slave nodes. The value "sync" means that the slave node is a synchronous slave, "potential" means that the slave node is a potentially synchronous node, and "async" means that the slave node async" means the slave is an asynchronous slave. 
PATH:node data path, you need to ensure that the directory is empty. 
INITIALIZED:Identifies whether the node is initialized. 
INCLUSTER:Identifies whether the node is in the cluster. 
Enter fullscreen mode Exit fullscreen mode

Command example:

-- Displays node information in node table: 
LIST NODE; 
-- Displays information about the node with the node name "db1": 
LIST NODE db1; 
-- Display master/slave node information for db1_2: 
list node datanode master db1_2; 
-- Displays node information on host localhost1: 
list node host localhost1; 
-- Displays all nodes under the local zone. There will be 2 zones in the dual-center scenario:
list node zone local;
Enter fullscreen mode Exit fullscreen mode

param table related commands


The param table is used to manage the parameters in the postgresql.conf file that holds all the nodes in the AntDB cluster. When a parameter is modified, it is added to this table and used to identify it. For querying the modified configuration parameters, you can use the list param command.

set param


Command function:

Change the parameter in the postgresql.conf node configuration file. If the parameter is valid, the system will perform the relevant operation internally to make the change effective. This operation only applies to those parameter types that do not require restarting the cluster (such as sighup, user, superuser), while for modifying other types of parameters, the corresponding prompt will be given. If force is added at the end of the command, the validity of the parameter is not checked, but forced to be written to a file, and the system does not perform any operation, but only serves as a record.

Command format:

SET COORDINATOR [ MASTER | SLAVE ] ALL ( { parameter = value } [, ...] ) [ FORCE ] 
SET COORDINATOR { MASTER | SLAVE} node_name ( { parameter = value } [, ...] ) [ FORCE ] 
SET DATANODE [ MASTER | SLAVE ] ALL ( { parameter = value } [, ...] ) [ FORCE ] 
SET DATANODE { MASTER | SLAVE } node_name ( { parameter = value } [, ...] ) [ FORCE ] 
SET GTMCOORD ALL ( { parameter = value } [, ...] ) [ FORCE ] 
SET GTMCOORD { MASTER | SLAVE } node_name ( { parameter = value } [, ...] ) [ FORCE ] 
Enter fullscreen mode Exit fullscreen mode

Command example:

-- Modify deadlock time on coord1 
SET  COORDINATOR  MASTER coord1(deadlock_timeout = '1000ms'); 
-- Modify the checkpoint_timeout parameter in the configuration file on all datanodes. 
SET  DATANODE  all(checkpoint_timeout = '1000s'); 
-- Modify a non-existent parameter in the configuration file on all datanodes 
SET  DATANODE  all(checkpoint = '10s')  FORCE; 
Enter fullscreen mode Exit fullscreen mode

reset param


Command function:

Change the parameters in the postgresql.conf file to default values.

Command format:

RESET COORDINATOR [ MASTER | SLAVE ] ALL ( parameter [, ...] ) [ FORCE ] 
RESET COORDINATOR { MASTER | SLAVE } node_name ( parameter [, ...] ) [ FORCE ] 
RESET DATANODE [ MASTER | SLAVE ] ALL ( parameter [, ...] ) [ FORCE ]  
RESET DATANODE { MASTER | SLAVE } node_name ( parameter [, ...] ) [ FORCE ] 
RESET GTMCOORD ALL ( parameter [, ...] ) [ FORCE ]  
RESET GTMCOORD { MASTER | SLAVE } node_name ( parameter [, ...] ) [ FORCE ] 
Enter fullscreen mode Exit fullscreen mode

Command example:

-- Change the configuration parameter checkpoint_timeout of datanode master db1 to its default value. Where the * sign in the query result is an adaptor indicating all node names that meet the condition. 
RESET  DATANODE  MASTER  db1 (checkpoint_timeout); 
-- Change all configuration parameters checkpoint_timeout in datanode to default values 
RESET  DATANODE  all (checkpoint_timeout); 
Enter fullscreen mode Exit fullscreen mode

list param


Command function:

Query the list of modified parameters in the node's postgresql.conf configuration file.

Command format:

LIST PARAM 
LIST PARAM node_type node_name [ sub_like_string ] 
LIST PARAM cluster_type ALL [ sub_like_string ] 

where node_type can be one of: 

    GTMCOORD MASTER 
    GTMCOORD SLAVE 
    COORDINATOR MASTER 
    COORDINATOR SLAVE 
    DATANODE MASTER 
    DATANODE SLAVE 

where cluster_type can be one of: 

    GTMCOORD 
    COORDINATOR 
    DATANODE 
    DATANODE MASTER 
    DATANODE SLAVE 
Enter fullscreen mode Exit fullscreen mode

Command example:

--Query the modified parameter in the configuration file with the node type of datanode master and the node name of db1 
LIST  param  DATANODE  MASTER  db1; 
--Query the modified parameter in the configuration file in all nodes with the node type of coordinator
LIST  param  COORDINATOR  all; 
Enter fullscreen mode Exit fullscreen mode

Top comments (0)