lvs.cf & mysql

Sébastien BONNET sebastien.bonnet at experian.fr
Tue Jul 5 07:59:37 UTC 2005


> I have been looking for a way to monitor a mysql server, I tried to 
> modify the section for the real server to monitor the port 3306, but 
> when i start the pulse daemon, it says that there is and error on that line

You CAN'T specify the port per real server. It is a virtual server 
parameter. And you've mixed http and mysql ...

You should write a small shell script that tries ti connect to a mysql 
server given an IP address. If it succeed, print OK, else print FAIL.

Then use send_program = <path-to-your-script> instead of then send 
parameter below (see updated conf, supposing you have two real servers 
named mysql1 and mysql2).

> virtual HTTP1 {
virtual DB1 {
>     active = 1
>     address = 192.168.4.21 eth0:1
>     load_monitor = uptime
>     vip_nmask = 255.255.255.0
>     port = 80
     port = 3306
>     persistent = 20
Such a small persistence timeout is useless. Increase or remove !
>     send = "GET / HTTP/1.0\r\n\r\n"
send_program = "/etc/sysconfig/ha/check_mysql.sh"
>     expect = "HTTP"
expect = "OK"
>     load_monitor = none
>     scheduler = rr
>     protocol = tcp
>     timeout = 5
>     reentry = 5
> server http {
server mysql1 {
>         address = 192.168.5.40
>         active = 1
>         weight = 1
>     }
> 
> server mysql {
server mysql2 {
>         address = 192.168.5.59
>>       port = 3306   ***** here *****
remove this !
>         active = 1
>         weight = 1
>     }
> }

> I have spent almost 4 days trying to modify the nanny daemon to check 
> the port 3306 but it seems very difficult to me :(

Nanny does NOT need any modification to support mysql.

> has anyone done something like that?

I haven't used piranha to load balance mysql servers but some people 
already have. Dig a bit in the list archives and you'll find some 
interesting litterature !

-- 
Sébastien BONNET     --    Ingénieur système
Tel: 04.42.25.15.40      GSM: 06.64.44.58.98




More information about the Piranha-list mailing list