블로그 이미지
Flying Mr.Cheon youGom

Recent Comment»

Recent Post»

Recent Trackback»

« 2024/5 »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

[Infra] LoadBalancer Haproxy Install

서버/Infra | 2018. 3. 20. 16:25 | Posted by youGom

* 출처 : https://www.upcloud.com/support/haproxy-load-balancer-ubuntu/

* 간단하게 명령어만~


* haproxy 메뉴얼 주소 : https://cbonte.github.io/haproxy-dconv/1.7/configuration.html


sudo apt show haproxy
sudo add-apt-repository ppa:vbernat/haproxy-1.7
sudo apt update
sudo apt install -y haproxy
haproxy -v
HA-Proxy version 1.7.8-1ppa1~xenial 2017/07/09
Copyright 2000-2017 Willy Tarreau <willy@haproxy.org>

위에껀 명령어 아니고, 버젼 확인용~


sudo nano /etc/haproxy/haproxy.cfg
frontend http_front
   bind *:80
   stats uri /haproxy?stats
   default_backend http_back

backend http_back
   balance roundrobin
   server <server1 name> <private IP 1>:80 check
   server <server2 name> <private IP 2>:80 check
sudo nano /etc/haproxy/haproxy.cfg
frontend http_front
   bind *:80
   stats uri /haproxy?stats
   acl url_blog path_beg /blog
   use_backend blog_back if url_blog
   default_backend http_back

backend http_back
   balance roundrobin
   server <server name> <private IP>:80 check
   server <server name> <private IP>:80 check

backend blog_back
   server <server name> <private IP>:80 check
sudo systemctl restart haproxy
http://<load balancer public IP>/haproxy?stats
sudo systemctl status haproxy
listen stats
   bind *:8181
   stats enable
   stats uri /
   stats realm Haproxy\ Statistics
   stats auth username:password
sudo systemctl restart haproxy
http://<load balancer public IP>:8181
http://<load balancer public IP>/

* 아래 내용은 상세한 내용, 판도라상자? ㅋㅋ



'서버 > Infra' 카테고리의 다른 글

Docker Configuration  (0) 2023.05.11
: