AntDB Installation and Deployment Documentation - P3
Tags: database
Published: 2023-07-13 08:34:45

#### Parameter Setting Instructions

Parameter configuration for the AntDB database cluster can be done through adbmgr.

1.First connect to adbmgr using psql.

```
psql -d postgres -p [the port number of adbmgr]
```

For example:

```
psql -d postgres -p 31000
```

2.Command to set parameters; Set all nodes of the same type at the same time.

```
set datanode|coordinator|gtm all(key1=value1, key2=value2...);
```

Set the parameters of a particular node:

```
set{datanode|coordinator|gtm} {master|slave|extra} {nodename|all} (key1=value1, key2=value2...);
```

For example:

```
set datanode all (max_connections=800,shared_buffers='5GB', max_prepared_transactions=800,lock_timeout='60s',max_pool_size=800, wal_log_hints='on', full_page_writes='on', fsync='off',rep_max_avail_flag = 'on' );
set coordinator all (max_connections=400,shared_buffers='2GB',max_prepared_transactions=400,lock_timeout='60s',fsync='off',rep_max_avail_flag = 'on');
set gtmcoord all (max_connections=400,shared_buffers='2GB',max_prepared_transactions=400,lock_timeout='60s',fsync='off',rep_max_avail_flag = 'on');
```

3.Reboot. A prompt to reboot for certain parameters to take effect after they have been set.

```
stop all;
start all;
```

4.View parameter settings.

```
show param node name parameter name
```

For example:

```
postgres=# show param dm1 max_conn;
           type           | status |        message         
--------------------------+--------+------------------------
 datanode master dm1      | t      | max_connections = 2000
 datanode slave ds1_local | t      | max_connections = 2000
```

#### Cluster start-stop sequence

This refers to the clustered version of the service start-stop.

##### System startup sequence

1.Start adbmgr.

```
mgr_ctl start -D [the data directory of adbmgr] -l [Path to log file]
```

For example:

```
mgr_ctl start -D /home/uatadb/mgr -l /home/uatadb/mgr/logfile
```

2.Connecting to adbmgr using psql.

```
psql -d postgres -p [the port number of adbmgr]
```

For example:

```
psql -d postgres -p 31000
```

3.Start agent.

* Start all agent:

```
start agent all password ‘[agent login password for the installation user]’;
```

For example:

```
start agent all password '123456';
```

The above command is executed successfully provided that the passwords of the installation users on all hosts are the same; if the passwords of the agent installation users are different, you need to start the agents one by one. The command is as follows.

* Start an agent.

```
start agent [agent name] password ‘[agent login password for the installation user]’;
```

For example:

```
 start agent host1 password '123456';
```

4.Start the nodes in the cluster.

* Start all nodes.

```
start all;
```

* Start the specified node.

```
start {gtmcoord|coordinator|datanode} {master|slave} [node name]
```

For example:

```
start gtmcoord master start；
```

##### System stop sequence

1.Connecting to adbmgr using psql.

```
psql -d postgres -p [the port name of adbmgr]
```

For example:

```
psql -d postgres -p 31000
```

2.Stop all nodes in the cluster.

* Stop all nodes.

```
stop all;
```

* Stop specified nodes.

```
stop{gtmcoord|coordinator|datanode} {master|slave} [node name]
```

For example:

```
stop gtmcoord master start；
```

3.Stop the agent.

* Stop all agents.

```
stop agent all; 
```

* Stop individual agents.

```
stop agent [agent name];
```

4.Stop adbmgr.

```
mgr_ctl stop-D [the data directory of adbmgr]
```

For example:

```
mgr_ctl stop -D /home/uatadb/mgr
```