- port = 6033
- service xinetd start
If you want to use a different username or password for clustercheck, vi /usr/bin/clustercheck
On one percona node:
- mysql -uroot -p
- mysql> CREATE USER 'haproxy'@'192.168.70.12';
- mysql> CREATE USER 'haproxy'@'192.168.70.13';
- mysql> grant process on *.* to 'clustercheckuser'@'localhost' identified by 'clustercheckpassword!';
- mysql> flush privileges;
On two haproxy server:
yum -y install mysql
vi /etc/haproxy/haproxy.cfg
- defaults
- # option httplog
- # option http-server-close
- # option forwardfor except 127.0.0.0/8
- listen mysqld-status 192.168.70.10:3306
- balance source
- mode tcp
- option tcpka
- option mysql-check user haproxy
- server MySQL1 192.168.70.71:3306 check weight 1
- server MySQL2 192.168.70.72:3306 check weight 1
- server MySQL2 192.168.70.73:3306 check weight 1
- listen mysql-cluster 192.168.70.10:3306
- mode tcp
- balance source
- option httpchk
- server MySQL1 192.168.70.71:3306 check port 6033 inter 12000 rise 3 fall 3
- server MySQL1 192.168.70.72:3306 check port 6033 inter 12000 rise 3 fall 3
- server MySQL1 192.168.70.73:3306 check port 6033 inter 12000 rise 3 fall 3
- service haproxy reload
来源: http://www.bubuko.com/infodetail-2574544.html