Re: LVS, mon, and heartbeat, who's in control?

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: LVS, mon, and heartbeat, who's in control?
From: Juri Haberland <list-linux.lvs.users@xxxxxxxxxxx>
Date: Wed, 30 Jan 2002 17:05:33 +0000 (UTC)
Paul Lantinga <prl@xxxxxx> wrote:
> Good morning,
> We're running the .8.x stable code.  It works great in the default setup
> with one LVS server doing NAT.  Phase II means trying out 2 load balancers,
> as found at  This
> works fine using heartbeat to control lvs and mon in the manner found in the
> example haresources file.
>   clients -- switch -- lvs and lvs2 -- switch -- servers
> However, I've been asked to have mon monitor not only the real servers, but
> also the the IP addresses for the switches on the outside and the inside and
> to then kill heartbeat if it fails.  I added a section to the file to
> monitor the 'gateways' and to alert|upalert with
> heartbeat.alert|startheartbeat.alert.  The heartbeat alerts are simple
> scripts that do /etc/init.d/heartbeat stop|start and the haresources
> contains: lvs vip-http vip-servers lvs mon
> Of course, this killfest doesn't work b/c you can't have mon killing
> heartbeat and heartbeat killing mon as you're left with noone watching
> anything.  ;) .  
> So, I figured, how about having two mon instances or how about having mon
> control both heartbeat and lvs.
> The dual mon setup would be:
> - one instance of mon to watch my real servers that would pull servers in
> and out of service with the lvs.alert.  This would be started and stopped by
> heartbeat.  haresources would look like: lvs vip-http vip-servers mon
> - a second instance of mon would be started at boot time and would monitor
> the gateways hostgroup using a with:
>   hostgroup gateways gw1 gw2
>   watch gateways
>       service fping
>               interval 10s
>               monitor fping.monitor
>               period wd{Sun-Sat}
>               alert heartbeat.alert
>               upalert starthearbeat.alert
> The mon in control scenario would be:
> - push everything from the two mon configs above into one file.  
> Is either of these methods preferable? wise? unwise?  Has anyone else
> managed to get 2 instances of mon running on the same box?  Is anyone using
> mon to control heartbeat and lvs?

There is another possebility:
Mon allows you to enable/disable service groups.
If you start mon with the service group for monitoring the realservers
disabled then heartbeat could enable this group via haresources.

It looks a bit like this:
Disabling watch group "realservers":
echo -e "user=someuser\npass=password\ndisable watch realservers" | \
moncmd -a -s localhost

echo -e "user=someuser\npass=password\nenable watch realservers" | \
moncmd -a -s localhost


Juri Haberland  <juri@xxxxxxxxxxxxxx> 

<Prev in Thread] Current Thread [Next in Thread>