LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] problem with ldiretord and mysql

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [lvs-users] problem with ldiretord and mysql
From: Geoff Harrison <geoff.harrison@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 17 Aug 2010 12:12:49 -0400
Yes, we use this quite extensively:

our solution: use a designated table for determining the pool.

i.e.:

CREATE TABLE `sn_director_slave` (
  `enabled` tinyint(4) unsigned NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `enabled` (`enabled`)
) ENGINE=MEMORY DEFAULT CHARSET=utf8

then insert data into the table when you want it to be enabled:

insert into sn_director_slave values(1);

and truncate it on the slave when you don't:

truncate table sn_director_slave;

then you would use something like

select * from sn_director_slave where enabled=1;

for request:
        request = "SELECT * FROM sn_director_slave WHERE enabled = 1"

in your ldirector.cf

merely pull a slave from the pool when you're ready to run an optimize on it.  
ideally you're not going to be doing this that often anyways,
maybe once a week.


Geoff Harrison
Director of Systems Engineering
Match.com SN, LLC
(617) 301-6289



On Aug 17, 2010, at 7:53 AM, Schöke, Karsten wrote:

> Hi,
> 
> i have a LVS and i config a virtual IP for mysql.
> The setup is running.
> 
> here ist a extract fom my ldirectord.cfg
> 
> # Global Directives
> checktimeout=3
> checkinterval=2
> autoreload=yes
> quiescent=no
> 
> virtual = 10.133.3.162:3306
>        real=server1:3306 gate
>        real=server2:3306 gate
>        fallback=127.0.0.1:3306
>        service=mysql
>        scheduler=wlc
>        protocol=tcp
>        checktype=negotiate
>         negotiatetimeout=5
>        login="ldirectord"
>        passwd="*****"
>        database="test"
>        request="SELECT COUNT(*) FROM test.table"
> 
> 
> If the mysql Server on one node crashed, all connects go to another mysql 
> server.
> 
> But, my problem is, while the table are optimize the are locked by the mysqld.
> (the are 35 millons of rows)
> The ldirectord can connect to the mysql server, but the query give no anser, 
> the are in queue...
> My applikations can't wait for finish the mysql optimize table prozess.
> The negotiatetimeout=5 has no effect.
> 
> have any user a solution of this problem?
> 
> 
> thx
> Karsten
> 
> 
> 
> 
> 
> 
> 
> _______________________________________________
> 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


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