frontend ceph-radosgw
bind *:7480
timeout client 8s
default_backend ceph-radosgw
backend ceph-radosgw
mode tcp
balance roundrobin
timeout connect 8s
timeout server 8s
retries 2
#option external-check
#external-check command /var/lib/haproxy/health_check.sh
server cpeh240 10.9.10.234:7480 check
server ceph241 10.9.10.235:7480 check
server ceph243 10.9.10.236:7480 check
tcp 连接 mysql galera cluster
frontend mysql
bind *:3306
timeout client 1800s
default_backend mysql
backend mysql
balance source
option tcpka
timeout connect 8s
timeout server 1800s
retries 2
server mysql231 10.9.10.231:3306 check inter 4s
server mysql232 10.9.10.232:3306 check inter 4s
server mysql233 10.9.10.233:3306 check inter 4s
tcp 连接 redis 主库
frontend redis
bind *:6379
timeout client 1800s
default_backend redis
backend redis
balance roundrobin
timeout connect 8s
timeout server 1800s
retries 2
option tcp-check
tcp-check connect
tcp-check send PING\r\n
tcp-check expect string +PONG
tcp-check send info\ replication\r\n
tcp-check expect string role:master
tcp-check send QUIT\r\n
tcp-check expect string +OK
server redis87 10.1.14.87:6379 check inter 4s
server redis88 10.1.14.88:6379 check inter 4s
server redis89 10.1.14.89:6379 check inter 4s
状态页面
listen admin_stats
bind 0.0.0.0:10080
mode http
maxconn 100
timeout client 1m
timeout connect 4s
timeout server 4s
stats refresh 30s
stats uri /
stats auth username:password
stats realm haproxy for private user, enter username/password
stats hide-version