I’m trying to setup high-availability MySQL master-master cluster using HAProxy in Kubernetes.
Looks ok to me, the HAProxy stats show it connects MySQLs well and no error logs from pods of HAProxy. However, I can’t connect MySQL thru HAProxy and have the error below. Any clue?
I have no name!@mysql1-client:/$ mysql -hhaproxy.mysql.svc.cluster.local -uroot -p_____ -P3306
mysql: Can't get stat of '/opt/bitnami/mysql/conf/bitnami/my_custom.cnf' (OS errno 2 - No such file or directory)
mysql: [ERROR] Stopped processing the 'include' directive in file /opt/bitnami/mysql/conf/my.cnf at line 30.
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2003 (HY000): Can't connect to MySQL server on 'haproxy.mysql.svc.cluster.local:3306' (111)
global
log stdout format raw local0
maxconn 4096
defaults
log global
retries 2
balance roundrobin
timeout client 60s
timeout connect 60s
timeout server 60s
listen mysql
mode tcp
bind *:3306
balance roundrobin
option tcpka
option mysql-check user haproxy_check
server mysql-primary 10.245.11.43:3306 check
server mysql-secondary 10.245.98.225:3306 check
listen stats
bind *:1936
mode http
stats enable
stats hide-version
stats realm Haproxy\ Statistics
stats uri /
stats auth Username:Password