LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] Decreasing the number of backup nodes!!

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [lvs-users] Decreasing the number of backup nodes!!
Cc: keepalived-devel <keepalived-devel@xxxxxxxxxxxxxxxxxxxxx>
From: Graeme Fowler <graeme@xxxxxxxxxxx>
Date: Thu, 17 Apr 2008 11:08:14 +0100
[Ccing keepalived-devel <keepalived-devel@xxxxxxxxxxxxxxxxxxxxx> for
completeness]

On Thu, 2008-04-17 at 11:08 +0400, Ramsurrun Visham wrote:
> > When you say "keepalived parameters", what do you mean? VRRP settings?
> > LVS settings? Health check settings? Something else?
> >
> By Keepalived parameters I meant changing, for example the value of
> the priority field in a vrrp_instance while keepalived is running. Are
> there any console commands to do so or do I have to stop keepalived,
> change the .conf file manually and then re-start Keepalived?

No.

You can change almost any paramater in the config file and then do a
reload (rather than restart). You can either do this by doing "service
keepalived reload" if you're on a RH derived system, or you can send the
running keepalived master process a HUP signal.

Warning: this is untested, and I fully expect that you could really,
really shoot yourself in the foot when making changes like this,
especially with regards to VRRP.

I'd expect that, for example, a change of VRRP priority would require a
few seconds to converge, during which time you could have a network
interruption.

Alternatively, see the "vrrp_script" and "misc_dynamic" options for
keepalived. They allow you to dynamically update a VRRP priority and the
weight of a realserver respectively by running an external script.

I use vrrp_script like so:

vrrp_script check_running {
   script "/usr/local/bin/check_running"
   interval 10
   weight 10
}

vrrp_instance MAIL1 {
 ...redacted...
 track_script {
        check_running weight 20
 }
}
EOF


The script "/usr/local/bin/check_running" looks like this:

#!/bin/bash
killall -0 $NAME_OF_PROCESS >/dev/null 2>&1
if [ $? -eq 0 ]
then
  exit 0
else
  exit 1
fi

$NAME_OF_PROCESS would be up to you - in my case I make sure my frontend
mail server process is running. If it isn't, the priority of the VRRP
instance is reduced by 20, which takes it below that of the BACKUP
instance so the system duly fails over.

Hope that helps.

Graeme



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