0

Good day.

I'm following this article to configure HAProxy to balance with roundrobin between 3 MySQL servers (db1, db2, db3) in a MariaDB Galera cluster (working perfectly).

However I have a problem. In the tutorial there's a "Testing Load Balancing and Failover" area, in which I must execute the command mysql -h 127.0.0.1 -u haproxy_root -p -e "show variables like 'server_id'" to see the same result along with the server name. Executing the same command more than once will show the roundrobin jumping between db1 and db2 and viceversa... it never pass to db3. I'm reading everywhere and roundrobin should jump between all the servers, but in my case it just work between db1 and db2, why not in db3?

Check my HAProxy configuration:

global
    log 127.0.0.1 local0 notice
    user haproxy
    group haproxy

defaults
    log global
    retries 2
    timeout connect 3000
    timeout server 5000
    timeout client 5000

listen mysql-cluster
    bind 0.0.0.0:3306
    mode tcp
    option mysql-check user haproxy_check
    balance roundrobin
    server db1 172.28.109.10:3306 check
    server db2 172.28.109.11:3306 check
    server db3 172.28.109.12:3306 check

listen 127.0.0.1:8080
    mode http
    stats enable
    stats uri /
    stats realm Strictly\ Private
    stats auth monitor_user:password

Those 3 servers are properly declared in my MariaDB Galera Cluster configuration file, and they share behave perfectly in between. Check part of it here:

wsrep_provider=/usr/lib64/galera/libgalera_smm.so
wsrep_cluster_address="gcomm://171.28.109.10, 171.28.109.11, 171.28.109.12"
wsrep_cluster_name='galera_cluster'
wsrep_node_address='171.28.109.10'
wsrep_node_name='db1'
wsrep_sst_method=rsync
wsrep_sst_auth="user:password"

What am I missing? Please help me.

Thanks in advance.

  • How are you confirming that there is no connection request to db3 ? – x1b2j Jun 23 '15 at 23:02
  • Check the haproxy's status page, perhaps its health check is failing for db3 – sendmoreinfo Jul 8 '15 at 21:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.