Linux heartbeat: which one becomes master

heartbeathigh-availabilitylinux

Suppose I confiugred 2 machines to be active/passive with the linux heartbeat and pacemaker, then I create a resource group in node1, commit it. If I am correct the configuration will be propagated to node2. The resource group is going to monitor one of the service in the machine.

My question is, because the 2 nodes are running identical service, which one is becoming the active node firstly? Or the linux heartbeat will decide that(the two has equal possibility)?

Best Answer

With Pacemaker you don't have 'an active node' and 'a passive node'. All cluster nodes (there may be more than 2) can run services equally and the rules in the CIB database tell CRM (Pacemaker's resources manager) what node can run what services.

If you configured the service to run as a single instance that can run on both nodes with no constraints, then you cannot tell which node will run it. If you have two such services then you may end with one running on one node and the other on the other node. For the first service node1 will be active and for the second – node2.

You define actual preference by declaring some constants. Example: 'run service 1 on a node where service 2' is running or 'always prefer node 1 for both services'.

Usually you have a service which defines 'a logical master' – it can be an IP address or DRBD volume in the primary state – then all other services depend on this and you choose the 'master' by setting preferences for the primary service.

See the Pacemaker documentation for details on setting the constraints.

Heartbeat itself, when used with Pacemaker, doesn't make any decisions on master/slave states or on what resources are running.

Related Topic