[Pacemaker] adding ldirectord resource to pacemaker

geek at lenux.mine.nu geek at lenux.mine.nu
Thu Apr 8 10:43:13 UTC 2010


On Thu, 8 Apr 2010 09:26:57 +0530, Jayakrishnan
<jayakrishnanlll at gmail.com>
wrote:
> Hello Geek,
> 
> I just stared the same project in el5 itself yesterday. I wonder if we
> could
> go on as explained in Andrew's 'Cluster from scratch', it will give you
an
> active/active cluster. Wouldn't it gives you loadbalancing.
> 
> Pardon me if this is a stupid suggestion!!

Ok I got it :)

First thing, there is a bug in
/usr/lib/ocf/resource.d/heartbeat/ldirectord (package from the clusterlabs
redhat repo)
I have modified  at line 51 and 52 like this:

$> vi /usr/lib/ocf/resource.d/heartbeat/ldirectord

from
LDIRCONF=${OCF_RESKEY_configfile:-/usr/sbin/ldirectord/ldirectord.cf}
LDIRECTORD=${OCF_RESKEY_ldirectord:-/etc/ldirectord}

to
LDIRCONF=${OCF_RESKEY_configfile:-/etc/ldirectord.cf}
LDIRECTORD=${OCF_RESKEY_ldirectord:-/usr/sbin/ldirectord}

I will store the ldirectord configfile at /etc, the binary is located at
/usr/sbin/ldirectord

After that modification I was able to add an virtual ip and the ldirectord
resource to pacemaker like this:

$> crm
crm(live)# configure
crm(live)configure# primitive ldirectord ocf:heartbeat:ldirectord \
> params configfile="/etc/ldirectord.cf" \
> op monitor interval="2m" timeout="20s" \
> op start timeout="90s" op stop timeout="100s" 
crm(live)configure# primitive vip1 ocf:heartbeat:IPaddr2 \
> params lvs_support="true" ip="192.168.33.215" cidr_netmask="24"
broadcast="192.168.33.255" \                                       
> op monitor interval="2m" timeout="20s" \
> op start timeout="90s" op stop timeout="100s"
crm(live)configure# save
crm(live)configure# verify
crm(live)configure# end
crm(live)# status
============
Last updated: Thu Apr  8 12:37:43 2010
Stack: openais
Current DC: pacemaker1.lenux.local - partition WITHOUT quorum
Version: 1.0.8-9881a7350d6182bae9e8e557cf20a3cc5dac3ee7
1 Nodes configured, 2 expected votes
2 Resources configured.
============

Online: [ pacemaker1.office.local ]

 ldirectord     (ocf::heartbeat:ldirectord):    Started
pacemaker1.lenux.local
 vip1   (ocf::heartbeat:IPaddr2):       Started pacemaker1.lenux.local

Here my complete config file:
crm(live)# configure show
node pacemaker1.office.local
primitive ldirectord ocf:heartbeat:ldirectord \
        params configfile="/etc/ldirectord.cf" \
        op monitor interval="2m" timeout="20s" \
        op start interval="0" timeout="90s" \
        op stop interval="0" timeout="100s" \
        meta target-role="Started"
primitive vip1 ocf:heartbeat:IPaddr2 \
        params lvs_support="true" ip="192.168.33.215" cidr_netmask="24"
broadcast="192.168.33.255" \
        op monitor interval="2m" timeout="20s" \
        op start interval="0" timeout="90s" \
        op stop interval="0" timeout="100s"
property $id="cib-bootstrap-options" \
        dc-version="1.0.8-9881a7350d6182bae9e8e557cf20a3cc5dac3ee7" \
        cluster-infrastructure="openais" \
        expected-quorum-votes="2" \
        no-quorum-policy="ignore" \
        stonith-enabled="false"


I have add no-quorum-policy="ignore" stonith-enabled="false" because at
the moment I have only 1 node (have some multicast problems on cisco
switch) and I don't configure the stonith option. Of course ldirectord
should be installed.




More information about the Pacemaker mailing list