1 | [root@dbi-pg-essentials network-scripts]# service efm-3.3 start |
Running again the status command should show the VIP address. Restarting efm should be enough but if ever the virtual IP is not shown we can use following command to add the virtual IP.
1 | [root@dbi-pg-essentials network-scripts]# /usr/edb/efm-3.3/bin/efm_address add4 enp0s9 192.168.22.105/24 |
Then the status should be
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | [root@dbi-pg-tools ~]# /usr/edb/efm-3.3/bin/efm cluster-status efm Cluster Status: efm
Agent Type Address Agent DB VIP ----------------------------------------------------------------------- Witness 192.168.22.100 UP N/A 192.168.22.105 Master 192.168.22.101 UP UP 192.168.22.105* Standby 192.168.22.102 UP UP 192.168.22.105
Allowed node host list: 192.168.22.101 192.168.22.102 192.168.22.100
Membership coordinator: 192.168.22.101
Standby priority host list: 192.168.22.102
Promote Status:
DB Type Address XLog Loc Info -------------------------------------------------------------- Master 192.168.22.101 0/301BEE0 Standby 192.168.22.102 0/301BEE0
Standby database(s) in sync with master. It is safe to promote. [root@dbi-pg-tools ~]# |
We can manually ping the virtual IP from both servers. There should not exist any loss packets
1 2 3 4 5 6 7 | [root@dbi-pg-tools ~]# ping -q -c3 -w5 192.168.22.105 PING 192.168.22.105 (192.168.22.105) 56(84) bytes of data.
--- 192.168.22.105 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 2001ms rtt min/avg/max/mdev = 0.278/0.366/0.528/0.116 ms [root@dbi-pg-tools ~]# |
And from the master we can see that the VIP address is assigned to enp0s9
1 2 3 4 5 6 7 8 9 10 | [root@dbi-pg-essentials network-scripts]# ifconfig enp0s9 enp0s9: flags=4163 mtu 1500 inet 192.168.22.105 netmask 255.255.255.0 broadcast 0.0.0.0 ether 08:00:27:53:1c:ed txqueuelen 1000 (Ethernet) RX packets 3394 bytes 397433 (388.1 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 3096 bytes 571448 (558.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@dbi-pg-essentials network-scripts]# |
So we can use the virtual address to connect to the primary database
...