#---------------------------------------------------------------------# Global settings#---------------------------------------------------------------------Global # to has these messages end upinch/var/log/Haproxy.log You'll # need to: # #1) Configure Syslog to accept network log events. This is Done# by adding the'- R'Option to the Syslogd_optionsinch # /etc/sysconfig/Syslog # #2) Configure Local2 events to go to the/var/log/Haproxy.log #file. A line like the following can is added to #/etc/sysconfig/syslog # # Local2.*/var/log/Haproxy.log # Log127.0.0.1Local2chroot/var/lib/Haproxy Pidfile/var/run/haproxy.pid Maxconn4000User haproxy Group Haproxy daemon defaults mode TCP log Global option Httplog option Dontlognull retries3Timeout http-Request 10s Timeout queue 1m timeout Connect 10s timeout client 1m timeout s Erver 1m Timeout http-keep-Alive 10s Timeout Check 10s maxconn -Listen stats mode http bind0.0.0.0: thestats Enable stats hide-version stats URI/haproxyadmin?Stats Stats Realm haproxy\ Statistics stats auth admin:admin stats adminifTRUE frontend MySQL bind*:3306mode TCP log global default_backend mysqlservers backend mysqlservers balance leastconn server Dbsrv1 192.168.10.11:3306Check Port3306Intval2Rise1Fall2Maxconn -Server Dbsrv2192.168.10.12:3306Check Port3306Intval2Rise1Fall2Maxconn -
Haproxy Note Six: Load Balancer configuration example for MySQL service