apt-get install haproxy
vim /etc/haproxy/haproxy.cfg
and add text below:
stats uri /stats
stats auth sunmingming:solomon
frontend main
bind *:80
mode http
option httplog
log global
default_backend httppool
backend httppool
balance roundrobin
server hotwords 10.x0x.10x.4:80 maxconn 1024 check inter 2000 rise 2 fall 3
server hotwords2 127.0.0.1:8000 maxconn 1024 check inter 2000 rise 2 fall 3
- run haproxy
haproxy -f /etc/haproxy/haproxy.cfg