Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux Virtual Server: Users

[lvs-users] LVSSyncDaemonSwap syncid patch

 

 

Linux Virtual Server users RSS feed   Index | Next | Previous | View Threaded


st at mobilepeople

Aug 6, 2009, 5:24 AM

Post #1 of 4 (769 views)
Permalink
[lvs-users] LVSSyncDaemonSwap syncid patch

Dear LVS users,

Here is a patch to LVSSyncDaemonSwap.
It adds a syncid parameter allowing you to specify the ipvsadm daemon syncid
in the haresources file like this :
LVSSyncDaemonSwap::master::eth0::<sync_id>

The only drawback is that you have to specify the mcast interface in order
to use the syncid parameter.
Your comments are most welcome.
Regards

Sebastien

--- LVSSyncDaemonSwap.orig 2009-08-06 14:36:33.000000000 +0200
+++ LVSSyncDaemonSwap 2009-08-06 15:01:34.000000000 +0200
@@ -11,7 +11,8 @@
# Please note that as of 2.4.29, this is no longer needed
# as both the master and backup daemon can run simultaneously
#
-# usage: $0 {master|backup} {interface}
{start|stop|status|monitor|cleanup}
+# usage: $0 {master|backup} {interface {syncid}}
{start|stop|status|monitor|cleanup}
+# If you want to specify the syncid, you have to specify the mcast
interface first
#
# The first argument, master or backup, is the YING.
# The YANG is internally calculated to be which ever or master and
@@ -36,7 +37,7 @@
exec_prefix=/usr
. /etc/ha.d/shellfuncs

-USAGE="usage: $0 {master|backup} {interface}
{start|stop|status|monitor|cleanup}\n\nNote: $0 only works on Linux";
+USAGE="usage: $0 {master|backup} {interface {syncid}}
{start|stop|status|monitor|cleanup}\n\nNote: $0 only works on Linux";

# This is consistent with ldirectord's behaviour
# Except that this script does not have a debug mode
@@ -115,7 +116,7 @@
ha_log "info: ipvs_sync$YANG down"
fi

- run_ipvsadm --start-daemon $YING --mcast-interface=$IFACE || return $?
+ run_ipvsadm --start-daemon $YING --mcast-interface=$IFACE
--syncid=$SYNCID || return $?

ha_log "info: ipvs_sync$YING up"
return 0
@@ -157,8 +158,7 @@
echo -e $USAGE >&2
}

-if
- [ $# -lt 2 -o $# -gt 3 ]
+if [ $# -lt 2 -o $# -gt 4 ]
then
usage
exit 1
@@ -166,12 +166,19 @@

PS=$(ps ax | grep " \[ipvs[ _]sync")

-if [ $# -eq 3 ]
+if [ $# -eq 4 ]
+then
+ CMD=$4
+ SYNCID=$3
+ IFACE=$2
+elif [ $# -eq 3 ]
then
CMD=$3
+ SYNCID=0
IFACE=$2
else
CMD=$2
+ SYNCID=0
IFACE=eth0
fi
_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


horms at verge

Aug 6, 2009, 4:42 PM

Post #2 of 4 (706 views)
Permalink
Re: [lvs-users] LVSSyncDaemonSwap syncid patch [In reply to]

On Thu, Aug 06, 2009 at 02:24:26PM +0200, Sebastien Termeau wrote:
> Dear LVS users,
>
> Here is a patch to LVSSyncDaemonSwap.
> It adds a syncid parameter allowing you to specify the ipvsadm daemon syncid
> in the haresources file like this :
> LVSSyncDaemonSwap::master::eth0::<sync_id>
>
> The only drawback is that you have to specify the mcast interface in order
> to use the syncid parameter.
> Your comments are most welcome.

Hi Sebastien,

My only comment is that if your kernel is new enough that
the syncrhonisation daemon supports syncid, then it should
also be new enough that you can run the master and backup daemons
simultaneously, so there is no need for LVSSyncDaemonSwap on such systems.

That said, this change looks good to me and I'm happy to commit it.
Could you provide a signed-off-by line as per section 5 of
http://linux.yyz.us/patch-format.html ?

> Regards
>
> Sebastien
>
> --- LVSSyncDaemonSwap.orig 2009-08-06 14:36:33.000000000 +0200
> +++ LVSSyncDaemonSwap 2009-08-06 15:01:34.000000000 +0200
> @@ -11,7 +11,8 @@
> # Please note that as of 2.4.29, this is no longer needed
> # as both the master and backup daemon can run simultaneously
> #
> -# usage: $0 {master|backup} {interface}
> {start|stop|status|monitor|cleanup}
> +# usage: $0 {master|backup} {interface {syncid}}
> {start|stop|status|monitor|cleanup}
> +# If you want to specify the syncid, you have to specify the mcast
> interface first
> #
> # The first argument, master or backup, is the YING.
> # The YANG is internally calculated to be which ever or master and
> @@ -36,7 +37,7 @@
> exec_prefix=/usr
> . /etc/ha.d/shellfuncs
>
> -USAGE="usage: $0 {master|backup} {interface}
> {start|stop|status|monitor|cleanup}\n\nNote: $0 only works on Linux";
> +USAGE="usage: $0 {master|backup} {interface {syncid}}
> {start|stop|status|monitor|cleanup}\n\nNote: $0 only works on Linux";
>
> # This is consistent with ldirectord's behaviour
> # Except that this script does not have a debug mode
> @@ -115,7 +116,7 @@
> ha_log "info: ipvs_sync$YANG down"
> fi
>
> - run_ipvsadm --start-daemon $YING --mcast-interface=$IFACE || return $?
> + run_ipvsadm --start-daemon $YING --mcast-interface=$IFACE
> --syncid=$SYNCID || return $?
>
> ha_log "info: ipvs_sync$YING up"
> return 0
> @@ -157,8 +158,7 @@
> echo -e $USAGE >&2
> }
>
> -if
> - [ $# -lt 2 -o $# -gt 3 ]
> +if [ $# -lt 2 -o $# -gt 4 ]
> then
> usage
> exit 1
> @@ -166,12 +166,19 @@
>
> PS=$(ps ax | grep " \[ipvs[ _]sync")
>
> -if [ $# -eq 3 ]
> +if [ $# -eq 4 ]
> +then
> + CMD=$4
> + SYNCID=$3
> + IFACE=$2
> +elif [ $# -eq 3 ]
> then
> CMD=$3
> + SYNCID=0
> IFACE=$2
> else
> CMD=$2
> + SYNCID=0
> IFACE=eth0
> fi
> _______________________________________________
> Please read the documentation before posting - it's available at:
> http://www.linuxvirtualserver.org/
>
> LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
> Send requests to lvs-users-request [at] LinuxVirtualServer
> or go to http://lists.graemef.net/mailman/listinfo/lvs-users

_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


st at mobilepeople

Aug 7, 2009, 1:12 AM

Post #3 of 4 (714 views)
Permalink
Re: [lvs-users] LVSSyncDaemonSwap syncid patch [In reply to]

On Fri, Aug 7, 2009 at 1:42 AM, Simon Horman <horms [at] verge> wrote:

> On Thu, Aug 06, 2009 at 02:24:26PM +0200, Sebastien Termeau wrote:
> > Dear LVS users,
> >
> > Here is a patch to LVSSyncDaemonSwap.
> > It adds a syncid parameter allowing you to specify the ipvsadm daemon
> syncid
> > in the haresources file like this :
> > LVSSyncDaemonSwap::master::eth0::<sync_id>
> >
> > The only drawback is that you have to specify the mcast interface in
> order
> > to use the syncid parameter.
> > Your comments are most welcome.
>
> Hi Sebastien,
>
> My only comment is that if your kernel is new enough that
> the syncrhonisation daemon supports syncid, then it should
> also be new enough that you can run the master and backup daemons
> simultaneously, so there is no need for LVSSyncDaemonSwap on such systems.
>
> That said, this change looks good to me and I'm happy to commit it.
> Could you provide a signed-off-by line as per section 5 of
> http://linux.yyz.us/patch-format.html ?
>

Hi Simon

Sure, here it is:
Signed-off-by: Sebastien Termeau <st [at] mobilepeople>

To be honest I do not really understand the point of having both master and
slave running at the same time.
Ldirectord is only active on one box at any given time so the second master
seems useless for me.
How do you start the master and the slave? Do you have a init script for
this?
Hearbeat is starting ldirectord when it needs to be started thus I think it
should also take care of the ipvs sync daemon.
Many thanks

Sebastien
_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users


horms at verge

Aug 7, 2009, 11:56 PM

Post #4 of 4 (710 views)
Permalink
Re: [lvs-users] LVSSyncDaemonSwap syncid patch [In reply to]

On Fri, Aug 07, 2009 at 10:12:14AM +0200, Sebastien Termeau wrote:
> On Fri, Aug 7, 2009 at 1:42 AM, Simon Horman <horms [at] verge> wrote:
>
> > On Thu, Aug 06, 2009 at 02:24:26PM +0200, Sebastien Termeau wrote:
> > > Dear LVS users,
> > >
> > > Here is a patch to LVSSyncDaemonSwap.
> > > It adds a syncid parameter allowing you to specify the ipvsadm daemon
> > syncid
> > > in the haresources file like this :
> > > LVSSyncDaemonSwap::master::eth0::<sync_id>
> > >
> > > The only drawback is that you have to specify the mcast interface in
> > order
> > > to use the syncid parameter.
> > > Your comments are most welcome.
> >
> > Hi Sebastien,
> >
> > My only comment is that if your kernel is new enough that
> > the syncrhonisation daemon supports syncid, then it should
> > also be new enough that you can run the master and backup daemons
> > simultaneously, so there is no need for LVSSyncDaemonSwap on such systems.
> >
> > That said, this change looks good to me and I'm happy to commit it.
> > Could you provide a signed-off-by line as per section 5 of
> > http://linux.yyz.us/patch-format.html ?
> >
>
> Hi Simon
>
> Sure, here it is:
> Signed-off-by: Sebastien Termeau <st [at] mobilepeople>

Thanks, I've applied your change to http://hg.linux-ha.org/dev

> To be honest I do not really understand the point of having both master and
> slave running at the same time.
> Ldirectord is only active on one box at any given time so the second master
> seems useless for me.
> How do you start the master and the slave? Do you have a init script for
> this?
> Hearbeat is starting ldirectord when it needs to be started thus I think it
> should also take care of the ipvs sync daemon.

Thats up to you, I just feel that its easier to run them both at boot.

_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users [at] LinuxVirtualServer
Send requests to lvs-users-request [at] LinuxVirtualServer
or go to http://lists.graemef.net/mailman/listinfo/lvs-users

Linux Virtual Server users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.