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

Mailing List Archive: Linux Virtual Server: Users

[lvs-users] Cannot figure out failover balancing

 

 

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


Peter at PSDT

Jan 20, 2012, 5:13 PM

Post #1 of 4 (391 views)
Permalink
[lvs-users] Cannot figure out failover balancing

Hello. We are using the Redhat load balancing add-on that comes on RHEL
6. We want to have highly available MySQL; we have two co-master MySQL
servers that replicate to each other. MySQL says that that updates
should only come in to one of these at a time because of the possibility
that conflicting updates arrive at each server simultaneously. So we
want to use LVS to direct all traffic to one of the co-masters (call it
mysql01) except when it is down, in which case to direct all traffic to
the other one (call it mysql02).

We thought this requirement would be common enough to be addressable via
stock LVS capability. Our initial thought was to set the weight of
mysql01 to 1 and mysql02 to 0. However, new connections still went to
mysql02. We discovered
http://archive.linuxvirtualserver.org/html/lvs-users/2008-10/msg00101.html
and set the /etc/sysctl.conf parameters, also tried setting them via the
equivalent files in /proc/sys/net/ipv4/vs/, still connections went to
both servers even when we waited beyond the persistence timeout of 600s.

Because of this behavior, we are not able to test whether our approach
is sound to begin with; i.e., if mysql01 goes down will traffic be
redirected to mysql02 even though its weight is 0? We thought that if
it was the only machine up in its group the weight would not matter.
But would like to know if that assumption was accurate also.

Here's that section of our lvs.cf:

virtual MySQL {
active = 1
address = 192.168.185.115 eth0:6
vip_nmask = 255.255.255.0
fwmark = 3306
port = 3306
persistent = 600
use_regex = 0
load_monitor = none
scheduler = wlc
protocol = tcp
timeout = 6
reentry = 15
quiesce_server = 0
server MySQL01 {
address = 192.168.185.51
active = 1
port = 3306
weight = 1
}
server MySQL02 {
address = 192.168.185.52
active = 1
port = 3306
weight = 0
}
}

Would appreciate any advice. Thanks.

_______________________________________________
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


david at davidcoulson

Jan 20, 2012, 5:43 PM

Post #2 of 4 (359 views)
Permalink
Re: [lvs-users] Cannot figure out failover balancing [In reply to]

Why not just setup a resource in rgmanager (I'd say use pacemaker, but
RedHat doesn't support that yet), and move the MySQL IP between the
hosts, rather than messing around with IPVS?

David

On 1/20/12 8:13 PM, Peter Scott wrote:
> Hello. We are using the Redhat load balancing add-on that comes on RHEL
> 6. We want to have highly available MySQL; we have two co-master MySQL
> servers that replicate to each other. MySQL says that that updates
> should only come in to one of these at a time because of the possibility
> that conflicting updates arrive at each server simultaneously. So we
> want to use LVS to direct all traffic to one of the co-masters (call it
> mysql01) except when it is down, in which case to direct all traffic to
> the other one (call it mysql02).
>
> We thought this requirement would be common enough to be addressable via
> stock LVS capability. Our initial thought was to set the weight of
> mysql01 to 1 and mysql02 to 0. However, new connections still went to
> mysql02. We discovered
> http://archive.linuxvirtualserver.org/html/lvs-users/2008-10/msg00101.html
> and set the /etc/sysctl.conf parameters, also tried setting them via the
> equivalent files in /proc/sys/net/ipv4/vs/, still connections went to
> both servers even when we waited beyond the persistence timeout of 600s.
>
> Because of this behavior, we are not able to test whether our approach
> is sound to begin with; i.e., if mysql01 goes down will traffic be
> redirected to mysql02 even though its weight is 0? We thought that if
> it was the only machine up in its group the weight would not matter.
> But would like to know if that assumption was accurate also.
>
> Here's that section of our lvs.cf:
>
> virtual MySQL {
> active = 1
> address = 192.168.185.115 eth0:6
> vip_nmask = 255.255.255.0
> fwmark = 3306
> port = 3306
> persistent = 600
> use_regex = 0
> load_monitor = none
> scheduler = wlc
> protocol = tcp
> timeout = 6
> reentry = 15
> quiesce_server = 0
> server MySQL01 {
> address = 192.168.185.51
> active = 1
> port = 3306
> weight = 1
> }
> server MySQL02 {
> address = 192.168.185.52
> active = 1
> port = 3306
> weight = 0
> }
> }
>
> Would appreciate any advice. Thanks.
>
> _______________________________________________
> 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


Peter at PSDT

Jan 23, 2012, 1:40 PM

Post #3 of 4 (351 views)
Permalink
Re: [lvs-users] Cannot figure out failover balancing [In reply to]

Thanks! We're going to look at Pacemaker (which does seem to be
supported on RHEL6 after all). Looks like what we want.

On 1/20/2012 5:43 PM, David Coulson wrote:
> Why not just setup a resource in rgmanager (I'd say use pacemaker, but
> RedHat doesn't support that yet), and move the MySQL IP between the
> hosts, rather than messing around with IPVS?
>
> David
>
> On 1/20/12 8:13 PM, Peter Scott wrote:
>> Hello. We are using the Redhat load balancing add-on that comes on RHEL
>> 6. We want to have highly available MySQL; we have two co-master MySQL
>> servers that replicate to each other. MySQL says that that updates
>> should only come in to one of these at a time because of the possibility
>> that conflicting updates arrive at each server simultaneously. So we
>> want to use LVS to direct all traffic to one of the co-masters (call it
>> mysql01) except when it is down, in which case to direct all traffic to
>> the other one (call it mysql02).
>>
>> We thought this requirement would be common enough to be addressable via
>> stock LVS capability. Our initial thought was to set the weight of
>> mysql01 to 1 and mysql02 to 0. However, new connections still went to
>> mysql02. We discovered
>> http://archive.linuxvirtualserver.org/html/lvs-users/2008-10/msg00101.html
>>
>> and set the /etc/sysctl.conf parameters, also tried setting them via the
>> equivalent files in /proc/sys/net/ipv4/vs/, still connections went to
>> both servers even when we waited beyond the persistence timeout of 600s.
>>
>> Because of this behavior, we are not able to test whether our approach
>> is sound to begin with; i.e., if mysql01 goes down will traffic be
>> redirected to mysql02 even though its weight is 0? We thought that if
>> it was the only machine up in its group the weight would not matter.
>> But would like to know if that assumption was accurate also.
>>
>> Here's that section of our lvs.cf:
>>
>> virtual MySQL {
>> active = 1
>> address = 192.168.185.115 eth0:6
>> vip_nmask = 255.255.255.0
>> fwmark = 3306
>> port = 3306
>> persistent = 600
>> use_regex = 0
>> load_monitor = none
>> scheduler = wlc
>> protocol = tcp
>> timeout = 6
>> reentry = 15
>> quiesce_server = 0
>> server MySQL01 {
>> address = 192.168.185.51
>> active = 1
>> port = 3306
>> weight = 1
>> }
>> server MySQL02 {
>> address = 192.168.185.52
>> active = 1
>> port = 3306
>> weight = 0
>> }
>> }
>>
>> Would appreciate any advice. Thanks.
>>
>> _______________________________________________
>> 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


rohara at redhat

Jan 23, 2012, 8:00 PM

Post #4 of 4 (350 views)
Permalink
Re: [lvs-users] Cannot figure out failover balancing [In reply to]

On 01/23/2012 03:40 PM, Peter Scott wrote:
> Thanks! We're going to look at Pacemaker (which does seem to be
> supported on RHEL6 after all). Looks like what we want.

Pacemaker is not supported in RHEL6. It is considered Tech Preview.

Ryan

> On 1/20/2012 5:43 PM, David Coulson wrote:
>> Why not just setup a resource in rgmanager (I'd say use pacemaker, but
>> RedHat doesn't support that yet), and move the MySQL IP between the
>> hosts, rather than messing around with IPVS?
>>
>> David
>>
>> On 1/20/12 8:13 PM, Peter Scott wrote:
>>> Hello. We are using the Redhat load balancing add-on that comes on RHEL
>>> 6. We want to have highly available MySQL; we have two co-master MySQL
>>> servers that replicate to each other. MySQL says that that updates
>>> should only come in to one of these at a time because of the possibility
>>> that conflicting updates arrive at each server simultaneously. So we
>>> want to use LVS to direct all traffic to one of the co-masters (call it
>>> mysql01) except when it is down, in which case to direct all traffic to
>>> the other one (call it mysql02).
>>>
>>> We thought this requirement would be common enough to be addressable via
>>> stock LVS capability. Our initial thought was to set the weight of
>>> mysql01 to 1 and mysql02 to 0. However, new connections still went to
>>> mysql02. We discovered
>>> http://archive.linuxvirtualserver.org/html/lvs-users/2008-10/msg00101.html
>>>
>>> and set the /etc/sysctl.conf parameters, also tried setting them via the
>>> equivalent files in /proc/sys/net/ipv4/vs/, still connections went to
>>> both servers even when we waited beyond the persistence timeout of 600s.
>>>
>>> Because of this behavior, we are not able to test whether our approach
>>> is sound to begin with; i.e., if mysql01 goes down will traffic be
>>> redirected to mysql02 even though its weight is 0? We thought that if
>>> it was the only machine up in its group the weight would not matter.
>>> But would like to know if that assumption was accurate also.
>>>
>>> Here's that section of our lvs.cf:
>>>
>>> virtual MySQL {
>>> active = 1
>>> address = 192.168.185.115 eth0:6
>>> vip_nmask = 255.255.255.0
>>> fwmark = 3306
>>> port = 3306
>>> persistent = 600
>>> use_regex = 0
>>> load_monitor = none
>>> scheduler = wlc
>>> protocol = tcp
>>> timeout = 6
>>> reentry = 15
>>> quiesce_server = 0
>>> server MySQL01 {
>>> address = 192.168.185.51
>>> active = 1
>>> port = 3306
>>> weight = 1
>>> }
>>> server MySQL02 {
>>> address = 192.168.185.52
>>> active = 1
>>> port = 3306
>>> weight = 0
>>> }
>>> }
>>>
>>> Would appreciate any advice. Thanks.
>>>
>>> _______________________________________________
>>> 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

_______________________________________________
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.