Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
    
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 7:47

1 Answer 1

up vote 6 down vote accepted

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.

share|improve this answer
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: clusterlabs.org/doc/en-US/Pacemaker/1.1/html/… It is quite complicated at first, but when you get it 'just works' (with some magic inside) –  Jacek Konieczny Nov 24 '10 at 8:49

protected by sysadmin1138 Sep 24 '12 at 18:51

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.