LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

[lvs-users] MySQL Load Balancer/Cluster Connection Refused on Virtual IP

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: [lvs-users] MySQL Load Balancer/Cluster Connection Refused on Virtual IP
From: "Paul Bowden" <paul@xxxxxxxxxxxx>
Date: Fri, 30 May 2008 10:32:32 +0100
Hello,

I have configured a MySQL cluster on Ubuntu as per the how to at
http://www.howtoforge.com/loadbalanced_mysql_cluster_debian

There were no problems with the setup, however if I try to telnet to
the virtual ip on port 3306, I get connection refused. However I can
telnet to the two real server ip's on 3306. I can ping the virtual IP
fine, and if I unplug the machine that has the virtual IP, it switches
over to the second load balancer no problem (still can't connect on
3306 however).

I also ran tcpdump -vv port 3306 on lb1 (which had the virtual ip) and
this is what I get when I telnet 192.168.1.243 3306

tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
10:35:55.780669 IP (tos 0x0, ttl 128, id 6286, offset 0, flags [DF],
proto TCP (6), length 48) client-1.1805 > 192.168.1.243.mysql: S,
cksum 0x7109 (correct), 2355883198:2355883198(0) win 65535 <mss
1460,nop,nop,sackOK>
10:35:58.667032 IP (tos 0x0, ttl 128, id 6896, offset 0, flags [DF],
proto TCP (6), length 48) client-1.1805 > 192.168.1.243.mysql: S,
cksum 0x7109 (correct), 2355883198:2355883198(0) win 65535 <mss
1460,nop,nop,sackOK>
10:36:04.702617 IP (tos 0x0, ttl 128, id 8096, offset 0, flags [DF],
proto TCP (6), length 48) client-1.1805 > 192.168.1.243.mysql: S,
cksum 0x7109 (correct), 2355883198:2355883198(0) win 65535 <mss
1460,nop,nop,sackOK>

Can anyone point me in the right direction to diagnose and fix this problem?

Details:

virtual ip = 192.168.1.243
lb1 = 192.168.1.244
lb2 = 192.168.1.245
sql1 = 192.168.1.246
sql2 = 192.168.1.247

# Global Directives
checktimeout=10
checkinterval=2
autoreload=no
logfile="local0"
quiescent=yes

virtual=192.168.1.243:3306
       real=192.168.1.246:3306 gate
       real=192.168.1.247:3306 gate
       service=mysql
       checktype=negotiate
       login="ldirector"
       passwd="<hidden>"
       database="ldirectordb"
       request="SELECT * FROM connectioncheck"
       scheduler=wrr

root@lb1:/etc/ha.d# ip addr sh eth0

2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
   link/ether 00:30:1b:a0:50:bd brd ff:ff:ff:ff:ff:ff
   inet 192.168.1.244/24 brd 192.168.1.255 scope global eth0
   inet 192.168.1.243/24 brd 192.168.1.255 scope global secondary eth0
   inet6 fe80::230:1bff:fea0:50bd/64 scope link
      valid_lft forever preferred_lft forever

root@lb2:~# ip addr sh eth0

2: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
   link/ether 00:30:1b:a0:43:20 brd ff:ff:ff:ff:ff:ff
   inet 192.168.1.245/24 brd 192.168.1.255 scope global eth0
   inet6 fe80::230:1bff:fea0:4320/64 scope link
      valid_lft forever preferred_lft forever

root@lb1:/etc/ha.d# ipvsadm -L -n

IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
 -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
TCP  192.168.1.243:3306 wrr
 -> 192.168.1.246:3306           Route   0      0          0
 -> 192.168.1.247:3306           Route   0      0          0

root@lb2:~# ipvsadm -L -n

IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
 -> RemoteAddress:Port           Forward Weight ActiveConn InActConn

root@lb1:/etc/ha.d# ldirectord ldirectord.cf status

ldirectord for /etc/ha.d/ldirectord.cf is running with pid: 4940

root@lb2:~# ldirectord ldirectord.cf status

ldirectord is stopped for /etc/ha.d/ldirectord.cf

I also have net.ipv4.ip_forward = 1 in /etc/sysctl.conf on both lb1 and lb2.
Update: I have also tried changing the above line to:

net.ipv4.conf.default.forwarding=1
net.ipv4.conf.all.forwarding=1

on both load balancers (and ran sysctl -p), but still no joy.

Regards,

Paul


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