HAProxy Troubleshooting
Installation
<hostname>: Executing '/usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid -st $(cat /var/run/haproxy.pid)' [failed]
cat: /var/run/haproxy.pid: No such file or directory
[ALERT] 303/101715 (3163) : parsing [/etc/haproxy/haproxy.cfg:43]: unknown stats parameter 'admin', expects 'uri', 'realm', 'auth', 'scope', 'enable', 'hide-version', 'show-node', 'show-desc' or 'show-legends'.
[ALERT] 303/101715 (3163) : Error(s) found in configuration file : /etc/haproxy/haproxy.cfg [ALERT] 303/101715 (3163) : Fatal errors found in configuration.
Start with to get the latest s9s_haproxy script:
git clone git://github.com/severalnines/s9s-admin.git
cd s9s-admin/cluster
If you have already cloned it do:
cd s9s-admin/cluster
git pull
Then you have three options:
- Install haproxy from source, rerun s9s_haproxy with the -s optiion, like this:
./s9s_haproxy --install -i <clusterid> -h <lb hostname> -s - Install haproxy version 1.4.8 or later and run ./s9s_haproxy again.
- Change the s9s_production_haproxy.cfg template and comment out:
stats admin if AuthOkay_Admin
so it becomes:
#stats admin if AuthOkay_Admin
Run ./s9s-haproxy again. - If you are on Ubuntu 10.04:
There is backported personal repo containing haproxy 1.4.18 (ppa:natecarlson/haproxy) at this link https://launchpad.net/~natecarlson/+archive/haproxy
Add the personal repo using "add-apt-repository ppa:user/ppa-name", then "apt-get update". Now install haproxy again using "apt-get install haproxy". It will now pull down the 1.4.18 version of haproxy and install it (check with "dpkg -s haproxy).
GRANTs
Don't forget to GRANT the LOAD BALANCER access to the MySQL Servers.
Example:
The load balancer (haproxy) is installed on 10.176.131.76, listening on port 33306
Isssue the GRANT on the MySQL Servers, with the privileges you want to give the user, in this case only the SELECT privilege:
grant select on test.* to 'johan'@'10.176.131.76' identified by 'password';
MySQL Cluster: You need to execute the GRANT statement on all mysql servers.
Galera: Issue the GRANT on any MySQL Server.
Replication: Issue the GRANT on the replication master.
To test the connectivity:
/usr/local/mysql/bin/mysql -ujohan -ppassword -h10.176.131.76 -P33306
Please sign in to leave a comment.
Comments
0 comments