Skip to content

Instantly share code, notes, and snippets.

@harryge00
Created October 23, 2019 03:07
Show Gist options
  • Save harryge00/bfbeac38f5312a7f965a614af8efd5dc to your computer and use it in GitHub Desktop.
Save harryge00/bfbeac38f5312a7f965a614af8efd5dc to your computer and use it in GitHub Desktop.
haproxy.cfg
global
daemon
nbproc 1
pidfile /var/run/haproxy.pid
chroot /usr/local/etc/haproxy
defaults
mode tcp
retries 3
option redispatch
#option abortonclos
#option dontlognull
maxconn 4096
timeout connect 5000ms
timeout client 30000ms
timeout server 30000ms
#timeout check 2000
log 127.0.0.1 local0 err
#监控界面
listen admin_stats
#监控界面的访问的IP和端口
bind 0.0.0.0:8888
#访问协议
mode http
#URI相对地址
stats uri /dbs
#统计报告格式
stats realm Global\ statistics
#登陆帐户信息
stats auth admin:123456
listen proxy-mysql
bind 0.0.0.0:3306
mode tcp
balance static-rr
option tcplog
option mysql-check user haproxy
#maxconn 4086
#log 127.0.0.1 local0 debug
server mysql-master mysqlmaster-0-node.frameworkname.containerip.dcos.thisdcos.directory:3306 check inter 5000 rise 2 fall 3 weight 1 maxconn 2000
server mysql-slave mysqlslave-0-node.frameworkname.containerip.dcos.thisdcos.directory:3306 check inter 5000 rise 2 fall 3 weight 1 maxconn 2000 backup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment