200.200.200.51 server (모니터링)
200.200.200.30 django-1 (웹서버1)
200.200.200.40 django-2 (웹서버2)
200.200.200.55 database (데이터베이스)
200.200.200.50 haproxy (웹 분산처리)
vi /etc/haproxy/haproxy.cfg
bind :9000
stats enable
stats realm Haproxy\ Statistics
stats uri /haproxy_stats
listen web-lb
bind 0.0.0.0:80
mode http
balance roundrobin
option httpchk GET /test
server django-1 200.200.200.30:80 check
server django-2 200.200.200.40:80 check
database 설정은 django를 넣은 후 에 설정파일에 수정하는 사항이 있는 데 앞서 했던 내용과 동일하다. 배포참고!
200.200.200.50 haproxy 로 들어가도 연결이 가능하다!