HAProxy on galera cluster, server_id is always 0

January 19, 2017 1.6k views


I have just followed the following tutorial setting up a galera cluster. it seesmt obe working fine: https://www.digitalocean.com/community/tutorials/how-to-configure-a-galera-cluster-with-mysql-5-6-on-ubuntu-16-04

I also followed this tutorial since I want a load balancer in front of it: https://www.digitalocean.com/community/tutorials/how-to-use-haproxy-to-set-up-mysql-load-balancing–3

now, when executing the following to check if it works I always get server_id 0 returned.

mysql -h -u haproxy_root -p -e "show variables like 'server_id'"

my config looks like this

    log local0 notice
    user haproxy
    group haproxy

    log global
    retries 2
    timeout connect 3000
    timeout server 5000
    timeout client 5000
listen mysql-cluster
    mode tcp
    option mysql-check user haproxy_check
    balance roundrobin
    server galera-001 check
    server galera-002 check

When running this

mysql -h -u haproxy_root -p -e "SHOW DATABASES"

it returns 3 tables:
| Database |
| informationschema |
| mysql |
| performance
schema |

I don’t know how to fix this. anybody here has an idea?


1 Answer

Same here… Any updates?

Have another answer? Share your knowledge.