HAProxy with 'backup' failure

Posted by A.RG on Server Fault See other posts from Server Fault or by A.RG
Published on 2011-10-12T21:39:53Z Indexed on 2012/12/07 5:08 UTC
Read the original article Hit count: 357

Filed under:

I have a simple configuration of 2 MySQL being load balanced by HAProxy. For an unfortunate reason I need to use them in Passive\Active mode. So I thought I'd configure one DB as 'backup' and go to sleep. But I was wrong. Whenever I add the 'backup' to the server line HAProxy throws a communication link error (essentially saying 'no DB available" (with the 'backup' it works great). It just doesnt consider that server as a valid option any more...

I have tried this configuration:

listen mysql 10.0.0.109:3307

    mode tcp
    balance roundrobin
    option httpchk
    server db01 10.0.0.236:3306
    server db02 10.0.0.68:3306 backup

and also this configuration:

frontend mysql_proxy

    bind 10.0.0.109:3307
    default_backend mysql

backend mysql

mode tcp
balance roundrobin
option httpchk
server db01 10.0.0.236:3306  
server db02 10.0.0.68:3306 backup

Nothing worked!

Can anyone point me in the right direction?

Thanks

© Server Fault or respective owner

Related posts about haproxy