Add hosts and deploy binaries
1. Add host; add several hosts according to the planning, the cluster is deployed on several hosts.
add host hostname (port=22,protocol='ssh',adbhome='AntDB installation path coresponding to the host]',address='server IP',agentport=agent port number,user=host user);
• port: ssh port number, default 22.
• protocol: login protocol, default ssh, users can leave it out.
• adbhome: installation directory of antdb, the next deploy binary will copy the binary on mgr to this directory.
• address: host IP address (IPV4, IPV6 and domain names are supported).
• agentport: since an agent process will be started on each host, here is the corresponding port number.
• user: ssh login username; For example:
--IPv4
add host host227(port=22,protocol='ssh',adbhome='/home/uatadb/app',address='10.23.16.227',agentport=31001,user='uatadb');
add host host228(port=22,protocol='ssh',adbhome='/home/uatadb/app',address='10.23.16.228',agentport=31001,user='uatadb');
--IPv6
add host host227(port=22,protocol='ssh',adbhome='/home/uatadb/app',address='fc00::227',agentport=31001,user='uatadb');
add host host228(port=22,protocol='ssh',adbhome='/home/uatadb/app',address='fc00::228',agentport=31001,user='uatadb');
--doamin name
add host host227(port=22,protocol='ssh',adbhome='/home/uatadb/app',address='adb227.host.com',agentport=31001,user='uatadb');
add host host228(port=22,protocol='ssh',adbhome='/home/uatadb/app',address='adb228.host.com',agentport=31001,user='uatadb');
2. deploy binary program; The deploy command will package the AntDB binary executable files and send it to all hosts in the host table. If mutual trust is not set among the hosts in the cluster, deploy all requires user password (current user's login password), if mutual trust is set among the hosts, the tedious setting of password can be eliminated.
• Deploy all hosts at once:
deploy all password '123456';
• Deploy the specified hosts, for example, deploy the specified hosts adb01 and adb02:
deploy host227,host228 password '123456';
3. Start agent. There are two ways: start all the agents at once and start the specified host agent. Note: password is the linux system password corresponding to the host user in the host table, which is used to communicate with the host, not the user password of the AntDB database. When the password starts with a number, you need to add single quotes or double quotes, for example, password '12345z' is correct, password 12345z will report an error; if the password does not start with a number, you can add quotes or not.
• Start all agents at once:
start agent all password '123456';
• Start the specified agent, multiple hosts need to be executed multiple times, e.g.:
start agent host227,host228 password '123456';
start agent host227 password '123456';
When the password is incorrect and the start of the agent fails, the following error is reported:
postgres=# start agent host227 password '123456abc';
hostname | status | description
------------+--------+-------------------------------------------
adb01 | f | Authentication failed (username/password)
(1 row)