LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: mysql through lvs?

To: Joseph Mack <mack@xxxxxxxxxxx>
Subject: Re: mysql through lvs?
Cc: jake buchholz <jake@xxxxxxxxxx>, lvs-users@xxxxxxxxxxxxxxxxxxxxxx
From: jake buchholz <jake@xxxxxxxxxx>
Date: Sat, 1 Apr 2000 12:00:22 -0600
On Sat, Apr 01, 2000 at 11:53:14AM -0500, Joseph Mack wrote:
> On Fri, 31 Mar 2000, jake buchholz wrote:
> > Anyone have any success getting mysql to successfully connect through
> > LVS?
> 
> a previous posting sounded like someone had got http and mysql realservers
> running behind a director. The httpds had their own VIP (which the 
> client connected to) and they called the mysqlds, which had a separate
> VIP (each realserver had httpd or mysqld but not both). 

That was me.  In theory, that appeared to be the solution, but I didn't
have the opportunity to thoroughly test it at that point.

> I would expect that mysqld is just another single port service (although
> I haven't tried it). If it didn't work out of the box I'd be interested
> to know why.

I'd expect so as well, but it doesn't appear to be the case...

> > I can connect fine on the real server, but can't connect through the
> > LVS redirector...  
> 
> the control (eg another service like telnet) works fine?

Yep.  Telnet, SSL, HTTP, HTTPS, FTP all working fine.

> Is mysqld listening on the VIP (if you're running VS-DR) or the RIP
> (if you're running VS-NAT)?

mysqld (by default, at least) listens on all interfaces.  The VIP is up
on the box.

'mysql -h<VIP>' works fine on the mysql real server, but won't work from
anywhere else.

> > I can't just telnet to port 3309 from the real or
> > through the LVS though -- so my guess is that mysql is sensing that
> > something isn't quite right and refusing the connection...
> to make progress from here you're going to have to run tcpdump on the
> director and the realserver.

on the mysql real server...

        tcpdump dst host <VIP>

when i'm on the mysql real server, I connect with 'mysql -h<VIP>' successfullly
and I'm seeing tcpdump traffic.

if, from an outside box, I successfully connect to the real server via
'mysql -h<RIP>', no tcpdump output, obviously.

if, from an outside box, I want to connect via 'mysql -h<VIP>', the connect
fails, and I'm not seeing any tcpdump output on the mysql real server.

on the redirector...

        tcpdump host <RIP> or host <VIP>

from an outside box trying to connect via 'mysql -h<VIP>', I'm seeing two
lines:

12:52:52.654440 eth0 < <OIP>.62710 > <VIP>.mysql: S 2856299978:2856299978(0) 
win 32120 <mss 1460,sackOK,timestamp 264231195 0,nop,wscale 0> (DF)
12:52:52.654481 eth0 > <VIP>.mysql > <OIP>.62710: R 0:0(0) ack 2856299979 win 0

here's the ipvsadm -L info:

TCP  <VIP>:3309 rr
  -> <RIP>:3309          Route   1      0          0

If you'd like me to run more specific tcpdumps, let me know what they should
be...

> > the LVS -> real server for databases are 1:1.
> I'm sorry I don't know what this means

One mysql <VIP> -> one mysql <RIP>

>   what i'd like to use it
> > for is to be able to switch to a different mysql real server if one goes
> > down (for maintenance, etc.) 
> 
> so need a monitor for mysqld?

Not really.

> or to redistribute the databases if we add
> > a new mysql real server.
> 
> I would expect that multiple mysqlds will have to access the same
> file system (eg by nfs, other people are talking about gfs, but I 
> don't know if anyone has got it to work with LVS yet)

Haven't heard about gfs, but yes, the databases are served to the mysql real
servers via nfs.

-- 
Jake Buchholz, Senior Systems Administrator     :           /~\
ExecPC (a Voyager.net company, NASDAQ: VOYN)    :    ASCII  \ /  Against
Voyager.net Hosting Solutions Lead R&D Engineer :   Ribbon   X   HTML
GnuPG (PGP5/6) and PGP 2.6.2 pub keys available : Campaign  / \  Mail


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