2

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)?

Bin Chen
  • 165
  • 4
  • As an aside, you can force a standby or takeover with /usr/lib/heartbeat/hb_standby all (or hb_takeover all) – Sirex Nov 23 '10 at 07:47

1 Answers1

6

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.

Jacek Konieczny
  • 3,777
  • 2
  • 23
  • 22
  • 1
    actually I want to setup an active node and a passive node backup for the active node. Do you have any reference for me to start? I want a simple enough configuation to start and add more complex ones :) – Bin Chen Nov 23 '10 at 15:19
  • This is still too generic to give a simple answer. Everything depends on the services you want to run, the storage they use, etc. You just need to read the documentation: http://www.clusterlabs.org/doc/en-US/Pacemaker/1.1/html/Pacemaker_Explained/ It is quite complicated at first, but when you get it 'just works' (with some magic inside) – Jacek Konieczny Nov 24 '10 at 08:49