Add Nodes
Add node information such as gtmcoord, coordinator, datanode master, datanode slave in Node table. Note: host name must be from host table, port number should not conflict, and the folder specified by path must be empty, otherwise the initialization will fail and error will be reported. This setting is to prevent users from operating and forgetting that there is useful data information under the current node. Add command:
1. add gtmcoord information. The slave node must have a different name from the master node, so the specified master must exist, and the same asynchronous relationship is set by the SYNC_STATE parameter.
add gtmcoord master name(host='localhost3',port=xxx, path='xxx');add gtmcoord slave name for maste_name(host='localhost2',port=xxx, path='xxx'
2. add coordinator node.
add coordinator master name(path = 'xxx', host='localhost1', port=xxx);
3. add datanode master node.
add datanode master name(path = 'xxx', host='localhost1', port=xxx);
4. add datanode slave node add datanode slave information, the slave node must have a different name from the master, so the specified master must exist, and the same asynchronous relationship is set by the SYNC_STATE parameter.
add datanode slave name for master_name (host='localhost2', port=xxx, path='xxx', SYNC_STATE='sync');
After adding, use the command list node to view the information of the node just added. A complete example: (gtmcoord/datanode are one master and one slave)
add host adb01(port=22,protocol='ssh',adbhome='/opt/app/antdb',address="10.1.226.201",agentport=8432,user='antdb');
add host adb02(port=22,protocol='ssh',adbhome='/opt/app/antdb',address="10.1.226.202",agentport=8432,user='antdb');
add host adb03(port=22,protocol='ssh',adbhome='/opt/app/antdb',address="10.1.226.203",agentport=8432,user='antdb');
deploy all password '123456';
start agent all password '123456';
add gtmcoord master gc_1(host='adb03',port=6655, path='/home/antdb/data/gc_1');
add gtmcoord slave gc_2 for gc_1(host='adb02',port=6655,path='/home/antdb/data/gc_2');
add coordinator master cn1(host='adb01', port=5432,path = '/home/antdb/data/cn1');
add coordinator master cn2(host='adb02', port=5432,path = '/home/antdb/data/cn2');
add datanode master dn1_1(host='adb01', port=14332,path = '/home/antdb/data/dn1_1');
add datanode slave dn1_2 for dn1_1 (host='db02',port=14332,path='/home/antdb/data/dn1_2');
add datanode master dn2_1(host='adb02', port=24332,path = '/home/antdb/data/dn2_1');
add datanode slave dn2_2 for dn2_1(host='adb01',port=24332,path='/home/antdb/data/dn2_2');
Recommendations on node deployment for production environments:
• At most one coordinator on each host, with the same port for each coordinator.
• Because the application can also connect to gtmcoord, the host with gtmcoord can no longer deploy the coordinator during deployment.
• the ports of the datanode can use the same port on different hosts according to a group of nodes (one master and multiple slaves as a group, e.g. dn1_x).