【AntDB-T Installation and Deployment Documentation】Dual-center Environment Deployment Instructions
Dual-center environment deployment instructions
The dual-center environment is built in two main steps.
1. Build the main center
2. Build the secondary center
The deployment method of the primary center can be referred to the above distributed version (single center) installation and deployment chapter.
There are three main steps for deploying the sub-center.
1. Modify part of the configuration of the main center mgr
2. Deploy the mgr of the sub-center
3. Deploy the sub-center node
Modify part of the configuration of the main center mgr
Modify the hba file
Add the IP address of the host where the secondary center mgr is located to the pg_hba.conf file of the primary center mgr; otherwise, the establishment of stream replication will not be successful. For example:
host replication all 10.1.226.202/32 trust
Configure the password-free access of the backup center mgr in the hba file of all nodes in the backup center
Modify the postgresql.conf file
Change the value of the listen_addresses field in the postgresql.conf file of the primary center from the default localhost to *, or a list of IP addresses. Change the wal_level to hot_standby, refer to the following:
listen_addresses = '*'
max_wal_senders = 5
wal_keep_size = 5120
wal_level = replica
hot_standby = on
log_destination = 'csvlog'
logging_collector = on
log_directory = 'pg_log'
mgr_zone ='local' #Configured by the zone name of the actual main center, the default is local
Restart mgr
mgr_ctl restart -D /home/shan2/mgr
Deploy the mgr of the sub-center
Backup data directory
On the secondary machine, use the pg_basebackup command to set up the secondary mgr, you can refer to the "pg_basebackup --help" command for help.
#Connect to the main center's MGR for pg_basebackup
pg_basebackup -h 10.1.226.201 -p 7435 -X stream --nodename=mgr -R -D /home/shan2/smgr
Modify the postgresql.conf file
Modify the mgr_zone name in the postgresql.conf file of the subcenter mgr, and change it to "zone2", which is the name of the subcenter's zone.
mgr_zone = 'zone2' #Set up according to actual needs
Modify the folder permissions
Modify the permission of the folder where the slave mgr is located to 0700
chmod 0700 /home/shan2/smgr
Start the slave mgr
mgr_ctl start -D /home/shan2/smgr