1.安装haproxy
# yum install -y haproxy
2.配置haproxy
# cp /etc/haproxy/haproxy.cfg /etc/haproxy/haproxy.cfg.bak
# vim /etc/haproxy/haproxy.cfg
配置文件如下
global
ulimit-n 51200
defaults
log global
mode tcp
option dontlognull
timeout connect 1000
timeout client 150000
timeout server 150000
frontend ss-in
bind *:8988
default_backend ss-out
backend ss-out
server server1 SSIP:SS端口 maxconn 20480
3.开机启动
# chkconfig haproxy on
# service haproxy start