###########全局设置######### global log 127.0.0.1 local1 log 127.0.0.1 local3 notice daemon nbproc 2 pidfile /home/haproxy/haproxy/conf/haproxy.pid ulimit-n 819200 maxconn 40960 #chroot /usr/share/haproxy user haproxy group haproxy #debug #quiet ########默认设置############ defaults log global mode tcp option tcplog no option dontlognull retries 3 option abortonclose maxconn 4096 timeout connect 500000ms timeout client 300000ms timeout server 300000ms ########监控页面######## listen admin_stats bind 0.0.0.0:5080 mode http option httplog #log 127.0.0.1 local0 err maxconn 10 stats refresh 30s stats uri /stats stats realm XingCloud\ Haproxy stats auth administrator:chakanmima123 stats hide-version stats admin if TRUE #######转发端口设置########### ####登录服-1-2#### frontend kh bind *:8391 default_backend back1 ####游戏服-1#### frontend taiguo bind *:8392 default_backend back2 ###游戏服-1### backend back1 fullconn 40860 balance roundrobin server kh 38.54.4.253:8388 maxconn 20000 rise 3 fall 3 weight 2 ###游戏服-1### backend back2 fullconn 40860 balance roundrobin server taiguo 154.90.45.57:8388 maxconn 20000 rise 3 fall 3 weight 2