[Pacemaker] Prioritized failover

Nirmala nirmalas at huawei.com
Thu Nov 17 05:39:21 EST 2011

Florian Haas <florian at ...> writes:

> You can easily test this with the "Stateful" resource agent. Say you've
> got 5 nodes, alice, bob, charlie, daisy and eric. alice is meant to be
> your central master, bob is a slave to alice and a master to the three
> others. alice and bob should be able to switch roles.
> The following example configuration is untested, but it should suffice
> to illustrate the idea.
> node alice attributes class="central"
> node bob attributes class=central"
> node charlie attributes class="satellite"
> node daisy attributes class="satellite"
> node eric attributes class="satellite"

Is it possible for the nodes in "satellite" class to become "central" at any
point of time ?

 Master(alice)                                 Master(bob)
    |                                             |
 Slave/Master(bob)                             Slave/Master(eric)
      /  |  \                                     /     \
Slave Slave Slave                               Slave   Slave
(eric)(daisy) (charlie)                        (daisy)  (charlie)

Now if alice is restarted, it should be "satellite".

> primitive p_stateful1 ocf:pacemaker:Stateful
> primitive p_stateful2 ocf:pacemaker:Stateful
> ms ms_stateful1 p_stateful1 meta master-max=1 clone-max=2
> ms ms_stateful2 p_stateful2 meta master-max=1 clone-max=4
> location l_stateful1_on_central ms_stateful1 \
>   rule -inf: class ne central
> location l_stateful2_master_on_central ms_stateful2 \
>   rule $role=Master -inf: class ne central
> location l_stateful2_slave_on_satellite ms_stateful2 \
>   rule $role=Slave -inf: class ne satellite
> colocation c_stateful2_master_on_stateful1_slave
>   inf: ms_stateful2:Master ms_stateful1:Slave
> Take a look at what ocf:heartbeat:mysql and ocf:linbit:drbd do with
> crm_master. It will allow you to set a master preference in whatever way
> you see fit.


More information about the Pacemaker mailing list