LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

[lvs-users] ldirectord + mysql woes

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: [lvs-users] ldirectord + mysql woes
From: Tom Hendrikx <tom@xxxxxxxxxxxxx>
Date: Mon, 22 Jun 2015 12:34:14 +0200
Hi,

I've been trying to get mysql failover working using ldirectord. The
general idea is to have 2 mysql instances running in master-master setup
(works), then have a ldirectord in front of that sending all queries to
server mysql-1 (works), and have it send the queries to the other mysql
server (mysql-2) when server mysql-1 goes down (does not work).

I've tried several options in ldirectord config, but no luck. Current
config is:


checktimeout=3
checkinterval=1
failurecount=5
autoreload=yes
logfile="/var/log/ldirectord.log"

virtual=172.16.31.106:3306
        real=172.16.31.103:3306 gate 65535 # mysql-1
        real=172.16.31.102:3306 gate 1 # mysql-2
        service=mysql
        scheduler=wlc
        protocol=tcp
        checktype=negotiate
        quiescent=no
        login="ldirectord"
        passwd="redacted"
        database="mydb"
        request="SELECT COUNT(1) from mytable"


When I stop mysql at mysql-1, the queries all fail, they don't seem to
be sent to mysql-2.

When I switch the weights in the real= lines, all traffic goes to
mysql-2 (so mysql-2 + ldirectord setup seems to be functional), but when
I take down mysql on server mysql-2, the traffic does not go to mysql-1
and queries fail again.

I also tried to configure one server as real, and the other as fallback,
but this does not work either. ldirectord documentation is not really
clear on this, but it seems that the fallback directive is explicitly
deviced for returning http traffic?

Can somebody shed any light on how to get this working? Or how to debug
why the queries are failing (when the setup is deemed correct)?

Kind regards,
        Tom

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

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

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