[Pacemaker] designing a load balancer - request for comments

Klaus Darilion klaus.mailinglists at pernau.at
Fri Feb 11 11:55:58 EST 2011


Hi Raoul!

Am 11.02.2011 16:13, schrieb Raoul Bhatia [IPAX]:
> On 02/11/2011 03:07 PM, Klaus Darilion wrote:
...
>> Is there some protection in pacemaker to not endlessly trying to restart
>> such a broken service?
>>
>> Or, how should pacemaker behave if Kamailio on the active node crashes.
>> Shall it just restart Kamailio or shall it migrate the IP address to the
>> other node and then try to restart Kamailio on the inactive node?
> 
> pacemaker will not endlessly try to restart the configured resources:
> http://www.clusterlabs.org/doc/en-US/Pacemaker/1.0/html/Pacemaker_Explained/s-failure-migration.html
> 
> pacemaker can be configured to restart a resource e.g. for a couple of
> times and if this does not work, it will migrate to another host.
> (you can also configure pacemaker to migrate upon the first failure)
> 
> please read the documentation (link above)

OK.

> if the clone'd resource properly synchronizes by itself, you only need
> to migrate the (public) service ip address. a colocation rule will
> achieve that.

fine

> basic clone setup:
> primitive extip ocf:heartbeat:IPaddr2 \
>         params ip="a.b.c.d" nic="eth0.123" cidr_netmask="28" \
>         op monitor interval="30"
> primitive kamailio ocf:pernau:kamailio \
>         op monitor interval="30" timeout="30" \
>         op monitor interval="15" role="Slave" timeout="30" \
>         op monitor interval="10" role="Master" timeout="30"
> clone clone-kamailio kamailio
> colocation colo_extip_with_kamailio inf: extip ms-kamailio

If I understand it right, this means that extip (the virtual-IP
resource) must run on a node which also runs ms-kamailio. Shouldn't that
be 'kamailio' instead of 'ms-kamailio' or is there some implicit
resource naming happening?

Additionally I want the virtual-IP to be moved if upstream-connectivity
of a node is broken. Therefore I used ping as below:

primitive extip ocf:heartbeat:IPaddr \
        params ip="11.222.32.161" \
        op monitor interval="3s"
primitive pingtest ocf:pacemaker:ping \
        params host_list="11.222.53.113" multiplier="10" dampen="5s" \
        op monitor interval="10s"
clone clonePing pingtest
location aktiverLB extip \
        rule $id="aktiverLB-rule" -inf: not_defined pingd or pingd lte 0


So, now I am not sure anymore if I should use "location" or "colocation"
as constraint to have the virtual-IP only on a node which has
connectivity. I got the impression that colocation is for binary
decisions (Kamailio is either running or not) and location for resources
which may have non-binary score values (eg. ping score can be 0-x if I
ping x hosts).

So, will it be correct to just add

primitive pingtest ocf:pacemaker:ping \
        params host_list="11.222.53.113" multiplier="10" dampen="5s" \
        op monitor interval="10s"
clone clonePing pingtest
location aktiverLB extip \
        rule $id="aktiverLB-rule" -inf: not_defined pingd or pingd lte 0

to your configuration or do I have to change this constraint to a
"colocation" constraint?

Thanks
Klaus






More information about the Pacemaker mailing list