Product SiteDocumentation Site

8.4. Reconfigure Pacemaker for Active/Active

Almost everything is in place. Recent versions of DRBD are capable of operating in Primary/Primary mode and the filesystem we’re using is cluster aware. All we need to do now is reconfigure the cluster to take advantage of this.
This will involve a number of changes, so we’ll want work with a local cib file.
# pcs cluster cib active_cfg
There’s no point making the services active on both locations if we can’t reach them, so lets first clone the IP address. Cloned IPaddr2 resources use an iptables rule to ensure that each request only gets processed by one of the two clone instances. The additional meta options tell the cluster how many instances of the clone we want (one "request bucket" for each node) and that if all other nodes fail, then the remaining node should hold all of them. Otherwise the requests would be simply discarded.
# pcs -f active_cfg resource clone ClusterIP \
     globally-unique=true clone-max=2 clone-node-max=2
Notice when the ClusterIP becomes a clone, the constraints referencing ClusterIP now reference the clone. This is done automatically by pcs.
# pcs -f active_cfg constraint
Location Constraints:
Ordering Constraints:
  start ClusterIP-clone then start WebSite
  WebFS then WebSite
  promote WebDataClone then start WebFS
Colocation Constraints:
  WebSite with ClusterIP-clone
  WebFS with WebDataClone (with-rsc-role:Master)
  WebSite with WebFS
Now we must tell the ClusterIP how to decide which requests are processed by which hosts. To do this we must specify the clusterip_hash parameter.
# pcs -f active_cfg resource update ClusterIP clusterip_hash=sourceip
Next we need to convert the filesystem and Apache resources into clones.
Notice how pcs automatically updates the relevant constraints again.
# pcs -f active_cfg resource clone WebFS
# pcs -f active_cfg resource clone WebSite
# pcs -f active_cfg constraint
Location Constraints:
Ordering Constraints:
  start ClusterIP-clone then start WebSite-clone
  WebFS-clone then WebSite-clone
  promote WebDataClone then start WebFS-clone
Colocation Constraints:
  WebSite-clone with ClusterIP-clone
  WebFS-clone with WebDataClone (with-rsc-role:Master)
  WebSite-clone with WebFS-clone
The last step is to tell the cluster that it is now allowed to promote both instances to be Primary (aka. Master).
# pcs -f active_cfg resource update WebDataClone master-max=2
Review the configuration before uploading it to the cluster, quitting the shell and watching the cluster’s response
# pcs cluster push cib active_cfg
# pcs resource enable WebFS
After all the processes are started the status should look similar to this.
# pcs resource
 Master/Slave Set: WebDataClone [WebData]
     Masters: [ pcmk-2 pcmk-1 ]
 Clone Set: dlm-clone [dlm]
     Started: [ pcmk-2 pcmk-1 ]
 Clone Set: ClusterIP-clone [ClusterIP] (unique)
     ClusterIP:0        (ocf::heartbeat:IPaddr2) Started
     ClusterIP:1        (ocf::heartbeat:IPaddr2) Started
 Clone Set: WebFS-clone [WebFS]
     Started: [ pcmk-1 pcmk-2 ]
 Clone Set: WebSite-clone [WebSite]
     Started: [ pcmk-1 pcmk-2 ]

8.4.1. Testing Recovery

Note

TODO: Put one node into standby to demonstrate failover