Report this

What is the reason for this report?

HAProxy on galera cluster, server_id is always 0

Posted on January 19, 2017
base

By base

Hi,

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 127.0.0.1 -u haproxy_root -p -e "show variables like 'server_id'"

my config looks like this

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 127.0.0.1:3306
    mode tcp
    option mysql-check user haproxy_check
    balance roundrobin
    server galera-001 10.129.30.47:3306 check
    server galera-002 10.129.30.48:3306 check

When running this

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

it returns 3 tables: ±-------------------+ | Database | ±-------------------+ | information_schema | | mysql | | performance_schema | ±-------------------+

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

regards, Ronnie



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Same here… Any updates?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.