Manager Handbook for Distributed AntDB-T - P5
Tags: database
Published: 2023-07-31 07:09:14

#### show

---


**Command function:**

​	Displays the actual parameter information of the cluster nodes and supports fuzzy query.

**Command format:**

```
SHOW PARAM node_name parameter 
```

**Command example:**

```sql
-- Query the parameter with wal in the configuration file of node db1 in a fuzzy way
  show param db1  wal; 
-- Query the contents of the checkponit_timeout parameter in the configuration file of node db1 
  show param db1  checkpoint_timeout; 
```

### hba table related commands

---


The hba table is used to manage the configuration items in the pg\_hba.conf file that holds all coordiantor nodes in the AntDB cluster. When a configuration item is added, it is recorded in this table and used to identify it. For the added configuration items, you can display them by list hba command.

#### add hba

**Command function:** Add new hba configuration to coordinator. Obtain help information by `\h add hba`. 

**Command format:**

```sql
Syntax: 
ADD HBA GTMCOORD { ALL | nodename } ( "hba_value" ) 
ADD HBA COORDINATOR { ALL | nodename } ( "hba_value" ) 
ADD HBA DATANODE { ALL | nodename } ( "hba_value" ) 
 
where hba_value must be the following: 
 
    host database user IP-address IP-mask auth-method 
```

**Command example:**

```sql
-- Add the configuration for all users on the 10.0.0.0 IP side to access all databases via md5 authentication to the coordinator's hba: 
add hba coordinator all ("host all all 10.0.0.0 8 md5"); 
```

#### list hba

---


**Command function:**

Display the configuration items added by add hba. 

**Command format:**

```
LIST HBA [ coord_name [, ...] ] 
```

**Command example:**

```sql
	postgres=# list hba; 
 nodename |          hbavalue            
----------+----------------------------- 
 coord1   | host all all 10.0.0.0 8 md5 
 coord2   | host all all 10.0.0.0 8 md5 
 coord3   | host all all 10.0.0.0 8 md5 
 coord4   | host all all 10.0.0.0 8 md5 
(4 rows) 
```

#### drop hba

---


**Command function:**

Delete the configuration items added by add hba.

**Command format:**

```
Syntax: 
DROP HBA GTMCOORD { ALL | nodename } ( "hba_value" ) 
DROP HBA COORDINATOR { ALL | nodename } ( "hba_value" ) 
DROP HBA DATANODE { ALL | nodename } ( "hba_value" ) 
 
where hba_value must be the following: 
 
    host database user IP-address IP-mask auth-method 
```

**Command example:**

```sql
-- Remove the configuration for all users on the 10.0.0.0 IP side to access all databases via md5 authentication from the coordinator's hba:  
drop coordinator hba all ("host all all 10.0.0.0 8 trust"); 
```

#### show hba

---


**Command function:**

Display the hba information that is in the node `pg_hba.conf`.

**Command format:**

```
Description: show the content of the pg_hba.conf file 
Syntax: 
SHOW HBA { ALL | node_name } 
```

**Command example:**

```sql
-- Display hba information for node cn1 
show hba cn1; 
  nodetype   | nodename |                 hbavalue                  
-------------+----------+------------------------------------------ 
 coordinator | cn1      | local all all trust                     + 
             |          | host all all 127.0.0.1 32 trust         + 
             |          | host all all ::1 128 trust              + 
             |          | local replication all trust             + 
             |          | host replication all 127.0.0.1 32 trust + 
             |          | host replication all ::1 128 trust      + 
             |          | host all all 10.21.20.175 32 trust      + 
             |          | host all all 10.21.20.176 32 trust      + 
             |          | host all all 10.0.0.0 8 trust           + 
```

Unlike `list hba`, list only displays the hba information added by `add hba`, but `show hba` displays the contents of `pg_hba.conf` files in specific nodes. 

### 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:**

```sql
-- 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); 
```