【AntDB-T Installation and Deployment Documentation】Deploy the Slave Center Section
Deploy the slave center section
Add and deploy the slave host
Refer to Adding hosts and deploying binaries above.
Add a slave node
Note: The following operations can only be performed on the master mgr
Note: All master nodes in the master center must have a direct slave node in the slave center. slave nodes can have cascading slave nodes.
--For example: main center includes gtmcoord master gc; coordinator master coord0 and coord1; datanode master dm0 and dm1
--Then the sub-center must not be at least a corresponding backup node for the above master node
add coordinator slave sc0zone2 for coord0(path = '/home/shan2/pgdata_xc/coord/s0', host='host107', port=4338,zone='zone2');
add coordinator slave sc1zone2 for coord1(path = '/home/shan2/pgdata_xc/coord/s1', host='host108', port=4338,zone='zone2');
add gtmcoord slave gszone2 for gc(host='host107',port=6775, path='/home/shan2/pgdata_xc/sgc',zone='zone2');
add datanode slave ds1zone2 for dm1(host='host108',port=24335,path='/home/shan2/pgdata_xc/datanode/s1',zone='zone2');
add datanode slave ds0zone2 for dm0(host='host107',port=14335,path='/home/shan2/pgdata_xc/datanode/s0',zone='zone2');
View all nodes belonging to the specified sub-center:
list node zone zone_name;
For example:
postgres=# LIST NODE ZONE zone2;
name | host | type | mastername | port | sync_state | path | initialized | incluster | readonly | zone
----------+------------+-------------------+------------+-------+------------+-----------------------------------+-----------
--+-----------+----------+-------
gszone2 | host107 | gtmcoord slave | gtmcoord | 6775 | async | /home/shan2/pgdata_xc/sgc | f | f | f | zone2
sc0zone2 | host107 | coordinator slave | coord0 | 4338 | async | /home/shan2/pgdata_xc/coord/s0 | f | f | f | zone2
sc1zone2 | host108 | coordinator slave | coord1 | 4338 | async | /home/shan2/pgdata_xc/coord/s1 | f | f | f | zone2
ds0zone2 | host107 | datanode slave | dm0 | 14335 | async | /home/shan2/pgdata_xc/datanode/s0 | f | f | f | zone2
ds1zone2 | host108 | datanode slave | dm1 | 24335 | async | /home/shan2/pgdata_xc/datanode/s1 | f | f | f | zone2
(5 rows)
Initialization of sub-center nodes
Method 1: You can use append to initialize the nodes of the sub-center one by one. For example:
append coordinator slave sc0zone2;
append coordinator slave sc1zone2;
append gtmcoord slave gszone2;
append datanode slave ds1zone2;
append datanode slave ds0zone2;
Method 2: You can use the zone init command to add all nodes in zone2 at once , for example
ZONE INIT zone2;
Check the status of the subcenter nodes after initialization.
list node zone zone_name;
For example:
postgres=# LIST NODE ZONE zone2;
name | host | type | mastername | port | sync_state | path | initialize
d | incluster | readonly | zone
----------+------------+-------------------+------------+-------+------------+-----------------------------------+-----------
--+-----------+----------+-------
gszone2 | localhost2 | gtmcoord slave | gtmcoord | 6775 | async | /home/shan2/pgdata_xc/sgc | t
| t | f | zone2
sc0zone2 | localhost2 | coordinator slave | coord0 | 4338 | async | /home/shan2/pgdata_xc/coord/s0 | t
| t | f | zone2
sc1zone2 | localhost1 | coordinator slave | coord1 | 4338 | async | /home/shan2/pgdata_xc/coord/s1 | t
| t | f | zone2
ds0zone2 | localhost3 | datanode slave | dm0 | 14335 | async | /home/shan2/pgdata_xc/datanode/s0 | t
| t | f | zone2
ds1zone2 | localhost4 | datanode slave | dm1 | 24335 | async | /home/shan2/pgdata_xc/datanode/s1 | t
| t | f | zone2
(5 rows)
At this point, the sub-center is established.