In the last post we upgraded EDB EFM from version 2.0 to 2.1. In this post we’ll look at the new features. Actually we’ll look only at two of the new features in this post:

  • Failover Manager now simplifies cluster startup with the auto.allow.hosts property
  • efm promote now includes a -switchover option; the -switchover option instructs Failover Manager to perform a failover, promoting a Standby to Master, and then, return the Master node to the cluster as a Standby node. For more information

Lets go …

My failover cluster status is still fine:

[root@edbbart efm-2.1]$ /usr/edb-efm/bin/efm cluster-status efm 
Cluster Status: efm
VIP: 192.168.22.250
Automatic failover is disabled.

	Agent Type  Address              Agent  DB       Info
	--------------------------------------------------------------
	Witness     192.168.22.244       UP     N/A       
	Standby     192.168.22.243       UP     UP        
	Master      192.168.22.245       UP     UP        

Allowed node host list:
	192.168.22.244 192.168.22.243 192.168.22.245

Membership coordinator: 192.168.22.244

Standby priority host list:
	192.168.22.243

Promote Status:

	DB Type     Address              XLog Loc         Info
	--------------------------------------------------------------
	Master      192.168.22.245       0/3C000220       
	Standby     192.168.22.243       0/3C000220       

	Standby database(s) in sync with master. It is safe to promote.

The first bit we’re going to change is the auto.allow.hosts on the database servers. According to the documentation this should eliminate the need to allow the hosts to join the cluster and registration should happen automatically. So, lets change it from “false” to “true” on all nodes:

[root@ppasstandby efm-2.1]$ grep allow.hosts efm.properties
auto.allow.hosts=true

… and then lets add all nodes to the efm.nodes files on the witness:

[root@edbbart efm-2.1]$ cat efm.nodes
# List of node address:port combinations separated by whitespace.
# The list should include at least the membership coordinator's address.
192.168.22.244:9998 192.168.22.243:9998 192.168.22.245:9998

When we now shutdown the EFM service on all hosts and bring it up again on the witness what is the result?

[root@edbbart efm-2.1]$ systemctl stop efm-2.1.service  # do this on all hosts

Lets start on the witness again:

[root@edbbart efm-2.1]$ systemctl start efm-2.1.service
[root@edbbart efm-2.1]$ /usr/edb-efm/bin/efm cluster-status efm 
Cluster Status: efm
VIP: 192.168.22.250
Automatic failover is disabled.

	Agent Type  Address              Agent  DB       Info
	--------------------------------------------------------------
	Witness     192.168.22.244       UP     N/A       

Allowed node host list:
	192.168.22.244 192.168.22.243 192.168.22.245

Membership coordinator: 192.168.22.244

Standby priority host list:
	(List is empty.)

Promote Status:

Did not find XLog location for any nodes.

So far so good, all nodes are in the “Allowed” list. What happens when we start EFM on the current primary node:

[root@ppasstandby efm-2.1]$  systemctl start efm-2.1.service
[root@ppasstandby efm-2.1]$ 

We should see the node as a member now without explicitly allowing it to join:

[root@edbbart efm-2.1]$ /usr/edb-efm/bin/efm cluster-status efm 
Cluster Status: efm
VIP: 192.168.22.250
Automatic failover is disabled.

	Agent Type  Address              Agent  DB       Info
	--------------------------------------------------------------
	Witness     192.168.22.244       UP     N/A       
	Master      192.168.22.245       UP     UP        

Allowed node host list:
	192.168.22.244 192.168.22.243 192.168.22.245

Membership coordinator: 192.168.22.244

Standby priority host list:
	(List is empty.)

Promote Status:

	DB Type     Address              XLog Loc         Info
	--------------------------------------------------------------
	Master      192.168.22.245       0/3D000060       

	No standby databases were found.

Cool, same on the standby node:

[root@edbppas edb-efm]$ cat efm.nodes
# List of node address:port combinations separated by whitespace.
# The list should include at least the membership coordinator's address.
192.168.22.244:9998
[root@edbppas edb-efm]$  systemctl start efm-2.1.servic

What is the status:

[root@edbbart efm-2.1]$ /usr/edb-efm/bin/efm cluster-status efm 
Cluster Status: efm
VIP: 192.168.22.250
Automatic failover is disabled.

	Agent Type  Address              Agent  DB       Info
	--------------------------------------------------------------
	Witness     192.168.22.244       UP     N/A       
	Master      192.168.22.245       UP     UP        
	Standby     192.168.22.243       UP     UP        

Allowed node host list:
	192.168.22.244 192.168.22.243 192.168.22.245

Membership coordinator: 192.168.22.244

Standby priority host list:
	192.168.22.243

Promote Status:

	DB Type     Address              XLog Loc         Info
	--------------------------------------------------------------
	Master      192.168.22.245       0/3D000060       
	Standby     192.168.22.243       0/3D000060       

	Standby database(s) in sync with master. It is safe to promote.

Perfect. Makes it a bit easier and fewer things to remember to bring up a failover cluster.

Coming to the “big” new feature (at least in my opinion): Switching to the standby and making the old master automatically a new standby which follows the new master. According to the docs all we need to do is this:

[root@edbbart efm-2.1]$ /usr/edb-efm/bin/efm promote efm -switchover

Does it really work?

[root@edbbart efm-2.1]$ /usr/edb-efm/bin/efm promote efm -switchover
Promote/switchover command accepted by local agent. Proceeding with promotion and will reconfigure original master. Run the 'cluster-status' command for information about the new cluster state.

Hm, lets check the status:

[root@edbbart efm-2.1]$ /usr/edb-efm/bin/efm cluster-status efm 
Cluster Status: efm
VIP: 192.168.22.250
Automatic failover is disabled.

	Agent Type  Address              Agent  DB       Info
	--------------------------------------------------------------
	Witness     192.168.22.244       UP     N/A       
	Master      192.168.22.243       UP     UP        
	Standby     192.168.22.245       UP     UP        

Allowed node host list:
	192.168.22.244 192.168.22.245 192.168.22.243

Membership coordinator: 192.168.22.244

Standby priority host list:
	192.168.22.245

Promote Status:

	DB Type     Address              XLog Loc         Info
	--------------------------------------------------------------
	Master      192.168.22.243       0/410000D0       
	Standby     192.168.22.245       0/410000D0       

	Standby database(s) in sync with master. It is safe to promote.

It really worked! And backwards:

[root@edbbart ~]$ /usr/edb-efm/bin/efm promote efm -switchover
Promote/switchover command accepted by local agent. Proceeding with promotion and will reconfigure original master. Run the 'cluster-status' command for information about the new cluster state.

[root@edbbart ~]$ /usr/edb-efm/bin/efm cluster-status efm
Cluster Status: efm
VIP: 192.168.22.250
Automatic failover is disabled.

    Agent Type  Address              Agent  DB       Info
    --------------------------------------------------------------
    Witness     192.168.22.244       UP     N/A       
    Standby     192.168.22.243       UP     UP        
    Master      192.168.22.245       UP     UP        

Allowed node host list:
    192.168.22.244 192.168.22.245 192.168.22.243

Membership coordinator: 192.168.22.244

Standby priority host list:
    192.168.22.243

Promote Status:

    DB Type     Address              XLog Loc         Info
    --------------------------------------------------------------
    Master      192.168.22.245       0/480001A8       
    Standby     192.168.22.243       0/480001A8       

    Standby database(s) in sync with master. It is safe to promote.

Cool, that is really a great new feature.