Manager Handbook for Distributed AntDB-T - P23–2
Published: 2023-08-25 05:51:15

Node table

The node table is used to store information about each node in the deployed AntDB cluster, including the same/asynchronous relationship between slave and master nodes, etc.
The following is the data in the node table as viewed using the list node command: For example: Connect to adbmgr and execute:

```
postgres=# list node; 
```
The output is listed in the following table with a selection of 5 items:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rzgjfgj3qbc6c71bqjlm.png)
Each column in the node table is explained as follows:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4e40cfgvbr30ifblkisd.png)
The following are examples of commands commonly used to operate the node table (refer to Chapter 4 for more details on how to use the commands related to the node table).

```
-- Add node information for the AntDB cluster to the node table： 
add gtmcoord master gc_1 (host=localhost1,port=6768,path='/home/antdb/data/gc1'); 
add gtmcoord slave gc_2 for gtm_1 (host=localhost2,port=6768,path='/home/antdb/data/gc2'); 
add coordinator master coord1(host=localhost1, port=5532,path='/home/antdb/data/coord1'); 
add coordinator master coord2(host=localhost2, port=5532,path='/home/antdb/data/coord2'); 
add datanode master db1_1 (host=localhost1, port=15533,path='/home/antdb/data/db1'); 
add datanode slave db1_2 for db1_1 (host=localhost2, port=15533,path='/home/antdb/data/db1'); 
add datanode slave db1_3 for db1_1 (host=localhost3, port=15533,path='/home/antdb/data/db1'); 
add datanode master db2_1(host=localhost2, port=15436,path='/home/antdb/data/db2'); 
add datanode slave db2_2 for db2_1 (host=localhost1, port=15436,path='/home/antdb/data/db2'); 
add datanode slave db2_3 for db2_1 (host=localhost3, port=15436,path='/home/antdb/data/db2'); 
-- Modify a column in the node table (you can freely modify the value in the node table before the cluster has init)： 
alter datanode slave db1_2(port=34332); 
alter datanode master db1_1(port=8899);  
-- Delete a row in the node table (you can add and remove values from the node table at will before the cluster has init)： 
drop datanode slave db1_2; 
drop datanode master db1_1; 
drop coordinator master coord1; 
drop gtmcoord slave gc_2; 
-- Displays all node information in the node table： 
list node; 
```
Param table

The param table is used to store the configuration of variables in the postgresql.conf file for all nodes in the AntDB cluster. All the variables in the postgresql.conf file can be set in this table and reload the specified node.
The following is a view of the data in the param table via the list param command: For example: Connect to adbmgr and execute:

```
postgres=# list param;
```
The sample output is as follows:


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r52yssz4x10qm4vwqigr.png)

Each column of the param table is explained as follows:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hl8emrq94s5h4fduayz5.png)

```
-- Add a row to the param table： 
set gtmcoord all (max_connections=1200); 
set gtmcoord master gc_1(superuser_reserved_connections=13); 
set gtmcoord slave gc_2(superuser_reserved_connections=14); 
set coordinator all(autovacuum_max_workers=5); 
set coordinator coord1(checkpoint_segments=128); 
set coordinator coord2(checkpoint_segments=200); 
set datanode all(default_statistics_target=100); 
set datanode master db1_1 (autovacuum_vacuum_cost_delay='30ms'); 
set datanode slave db1_2 (autovacuum_vacuum_cost_delay='60ms'); 
set datanode slave db1_3 (autovacuum_vacuum_cost_delay='90ms'); 
-- Set the parameter back to the default value： 
reset datanode master all ( max_connections); 
-- Displays all data in the Param table： 
list param; 
```