I am running 2 dedicated servers on which each has HAProxy keepalived running, MySQL in master/master and Apache.
Load Balancing for Apache already works, but I can not get MySQL LB running.
HAProxy stats says: DB2 down "access denied for haproxy_check@db2 "
From a tutorial I have learned that I have to prepare mysql:
mysql -u root -p -e "INSERT INTO mysql.user (Host,User) values ('10.0.0.10','haproxy_check'); FLUSH PRIVILEGES;"
My haproxy config looks like this:
listen mysql-cluster bind 10.0.0.10:3306 mode tcp option mysql-check user haproxy_check balance roundrobin server db1 10.0.0.120:3307 check server db2 10.0.0.130:3307 check
Why is HAProxy trying to connect from 10.0.0.130 instead of his VIP 10.0.0.10?
I could of course grant access to 10.0.0.130 but this will ruin the idea of failover. This works by the way.