1). Deploy the distributed software
sh antdb_install.sh ### the difference between distributed and centralized software deployment is as follows
2). Configure ssh-free between servers, configure sudo privileges for antdb users
ssh-keygen -t rsa
ssh-copy-id 192.168.37.130
ssh-copy-id 192.168.37.131
ssh-copy-id 192.168.37.132
visudo (operate on 3 machines)
3). Turn off the firewall, selinux (operate on 3 machines)
systemctl stop firewalld.service
systemctl status firewalld.service
vi /etc/selinux/config (Modifying selinux requires a reboot of the host, operate on 3 machines)
Temporary shutdown can be done with setenforce 0sh antdb_init.sh -c ./setup/common/initconf-d.ini
4). Edit the distributed installation configuration file
cd /home/antdb/antdb-ce-7.2.0.openeuler20.x86_64/setup/common
vi initconf-d.ini
## clusterinfo configuration item description:
##
## cluster_type Classification:
## D indicates distributed version: all information in this file needs to be configured
## cluster_name: name of the database cluster
## cluster_user: The superuser of the database, usually is the operating system user who executes this installer
[clusterinfo]
cluster_type = D
cluster_name = antdbcluster
cluster_user = antdb
## mgr_info configuration item description (mgr is a distributed management node).
##
## antdb_apppath: the program directory of mgr node database
## antdb_datapath: the data directory of the mgr node database; it needs to be set as an empty directory and not crossed with the directories in other configuration items
## antdb_password: the initial password for the superuser of the database (see "cluster_user" for the superuser)
## antdb_port: the port number of the mgr node database
## primary_ip: the mgr node database ip, i.e. the host ip where this installer is executed
## primary_sshport: the SSH service port number of the host executing this installer
[mgr_info]
primary_ip = 192.168.37.130 ###the ip address of management node mgr
primary_sshport = 22
antdb_apppath = /home/antdb/app1/antdb ###antdb software directory
antdb_datapath = /home/antdb/data/mgr ###antdb mgr management node directory
antdb_password = antdb
antdb_port = 6656
## host_info configuration item description
##
## host_info format: hostname,protocol_port,protocol,antdb_apppath,antd b_agent_port,host_user,host_ip
## host_name: the name used to identify a host within AntDB, unique
## protocol_port: the service port number of the communication protocol used by AntDB (currently SSH port)
## protocol: the communication protocol that AntDB relies on (currently SSH)
## antdb_apppath: the installation directory of AntDB program on the host; it needs to be specified as an empty directory, which will be installed automatically during the initialization process
## antdb_agent_port: The port number used by the program AntDB Agent on the host
## host_user: The user of the operating system on the host, usually is the same username as in mgr_info
## host_ip: host ip address
[host_info]
host = adb01,22,ssh,/home/antdb/app1/antdb,60102,antdb,192.168.37.130 ###change to the corresponding IP address of the distributed machine
host = adb02,22,ssh,/home/antdb/app1/antdb,60102,antdb,192.168.37.131 ###change to the corresponding IP address of the distributed machine
host = adb03,22,ssh,/home/antdb/app1/antdb,60102,antdb,192.168.37.132 ###change to the corresponding IP address of the distributed machine
## node_info configuration item description
##
## node_info format: node_name,node_type,host_name,antdbdb_port,antdb_d atapath,role[,master_nodename,sync_mode]
## node_name: distributed node name, as the internal identifier of AntDB, unique
## node_type: distributed node type, including GC, CN, DN
## host_name: the host where this node is located, see host_info above
## antdbdb_port: the port number used by this node
## antdb_datapath: the database data directory used by this node; it needs to be specified as an empty directory
## role: the role of this node, including master (primary node), slave (standby node)
## master_nodename: the name of the primary node; this is required when the node type is slave
## sync_mode: the type of the backup node, including sync (synchronous), async (asynchronous); this is required when the node type is slave
### cluster networking, the architecture is 2 CN nodes, 1 DN master, 1 DN slave, 1 GTM master, 1 GTM slave, and the adb01,adb02,adb03 inside are the hosts added by [host_info].
[node_info]
node = cn1,CN,adb01,6655,/home/antdb/data/cn1,master
node = cn2,CN,adb02,6655,/home/antdb/data/cn2,master
node = dn1,DN,adb02,60105,/home/antdb/data/dn1,master
node = dn2,DN,adb03,60106,/home/antdb/data/dn2,slave,dn1,sync
node = gc_1,GC,adb03,60103,/home/antdb/data/gc_1,master
node = gc_2,GC,adb01,60103,/home/antdb/data/gc_2,slave,gc_1,sync
5). Execute initialization
...
...
The [Info] AntDB init succeeds appears, indicating that the distributed cluster was deployed successfully. The distributed cluster architecture is consistent with the configuration file.
6). After deployment, antdb will dynamically adjust the OS parameter limits, resource usage limits, and database parameters according to the server resource configuration
cat /etc/security/limits.conf ###resource limits
database parameters
7). Distributed database testing
Execute adb_list to view the distributed cluster
Enter to the mgr management node and check the cluster status
psql -p 6656 -d postgres
Login to CN1 node, execute the operation, go to CN2 node to view the data
Create database on CN1, and insert data
Query on CN2
View data on DN, only one DN master node is needed
The above is all about AntDB Community Version deployment on VMware Workstation virtual machine. AntDB Database team welcomes you to download and experience our product, and come to AntDB Q&A community to share your deployment experience to help us improve AntDB Community Version better.
AntDB Database Online Experience Lab: http://www.antdb.net/training
AntDB Q & A Community:http://ask.antdb.net/
[Tips] If you need the corresponding database migration tool of AntDB Community Version, you can contact the official staff to provide the support.