Prerequsite:
- edb installed
- efm installed
- configuration cluster
- open port 7800,7809 between node
Step configure:
install efm , get repo repo:
curl -1sSLf 'https://downloads.enterprisedb.com/gmwxCGUaP97Ygbc4eQB7x8mo7kSVzT9I/enterprise/setup.rpm.sh' | sudo -E bashinstall efm tools
sudo dnf -y install edb-efm47
Prereq before cluster on edb master
Create User Replicator for Replication Role only
su - enterprisedb psql edb create user replicator with replication encrypted password 'P@ssw0rd';Change postgresql.conf parameter
vi "/pgdata/postgresql.conf" cat "/pgdata/postgresql.conf" | grep -i listen_addresses listen_addresses = '*' # what IP address(es) to listen on;Change pg_hba.conf parameter
cat "/pgdata/pg_hba.conf" | grep -i replicator host replication replicator 192.168.200.113/32 trust host replication replicator 192.168.200.114/32 trustRestart edb-as-15 service
systemctl stop edb-as-15 systemctl start edb-as-15 systemctl status edb-as-15Check replication master status (After Slaves Configured)
psql edb select * from pg_stat_replication;
Prereq before cluster on edb slave
Set up pg_basebackup to enable replication stream
su - enterprisedb cd /pgdata rm -rf * pg_basebackup -h 192.168.200.113 -D /pgdata -U replicator -P -R -X stream -C -S dg_db_slave //or pg_basebackup -h 192.168.200.113 -D /var/lib/edb/as15/data -U replicator -P -R -X stream -C -S dg_db_slaveCheck replication receiver status
psql edb \x select * from pg_stat_wal_receiver;
Configure cluster on edb master
Change pg_hba.conf parameter
vi /pgdata/pg_hba.conf cat /pgdata/pg_hba.conf | grep -i 192.168. host replication replicator 192.168.200.113/32 trust host replication replicator 192.168.200.114/32 trust host all all 192.168.200.113/32 trust host all all 192.168.200.114/32 trust //restart systemctl restart edb-as-15Install EFM 4.7
yum install edb-efm47Encrypt Password to Place In EFM Cluster Properties
/usr/edb/efm-4.7/bin/efm encrypt efmChange efm.nodes & efm.properties parameter
note: for efm.node actually automatic add when already allow-nodes
chown efm:efm "/etc/edb/efm-4.7/efm.nodes" chown efm:efm "/etc/edb/efm-4.7/efm.properties" vi "/etc/edb/efm-4.7/efm.nodes" ; cat "/etc/edb/efm-4.7/efm.nodes" 192.168.200.114:7800for efm.properties
vi "/etc/edb/efm-4.7/efm.properties" {config }Start EFM Service
systemctl start edb-efm-4.7 systemctl status edb-efm-4.7Allow Primary, Standby and Replica (report) Nodes
/usr/edb/efm-4.7/bin/efm allow-node efm 192.168.200.114 //if have more node just add ip and runCheck EFM Cluster Status (Standby and Replica server not configured)
/usr/edb/efm-4.7/bin/efm cluster-status efmCheck Efm Cluster_Status (All Nodes Configured)
/usr/edb/efm-4.7/bin/efm cluster-status efm
Configure cluster on edb slave
Change pg_hba.conf parameter
vi /pgdata/pg_hba.conf cat /pgdata/pg_hba.conf | grep -i 192.168. host replication replicator 192.168.200.113/32 trust host replication replicator 192.168.200.114/32 trust host all all 192.168.200.113/32 trust host all all 192.168.200.114/32 trust //restart systemctl restart edb-as-15Instal EFM 4.7
yum install edb-efm47Change efm.nodes & efm.properties parameter
note: for efm.node actually automatic add when already allow-nodes
chown efm:efm "/etc/edb/efm-4.7/efm.nodes" chown efm:efm "/etc/edb/efm-4.7/efm.properties" vi "/etc/edb/efm-4.7/efm.nodes" ; cat "/etc/edb/efm-4.7/efm.nodes" 192.168.200.114:7800for efm.properties
vi "/etc/edb/efm-4.7/efm.properties" {config }Start EFM 4.7 Service
systemctl start edb-efm-4.7
systemctl status edb-efm-4.7
- Allow Primary, Standby and Replica (report) Nodes
/usr/edb/efm-4.7/bin/efm allow-node efm 192.168.200.114
//if have more node slave just add ip and run
- Check EFM Cluster-Status
/usr/edb/efm-4.7/bin/efm cluster-status efm
note-note
//refresh cluster
select pg_reload_conf();
//ajmmm