Skip to main content

Installer un serveur de Load Balancing - HAProxy

image-1607717025268.png

Contexte : le load balancing

 

 

 

apt-get update ; apt-get upgrade -y

 

apt-get install haproxy -y

 

nano /etc/haproxy/haproxy.cfg

 

# FrontEND
frontend frontend-base
        # IP d'écoute du proxy.
        bind 172.31.64.100:80
        default_backend backend-base
        option forwardfor

backend backend-base
        # On utilise le mode Roundrobin
        balance roundrobin
        # On liste les serveurs de backend
        server  serveur-web-1   172.31.64.101:80 check
        server  serveur-web-2   172.31.64.102:80 check

 

 

 

 

 

image-1607719992443.png

 

image-1607720011807.png

 

image-1607720034246.png

image-1607720068441.png