Skip to main content

Installer un serveur de Load Balancing - HAProxy

image-1607717025268.png

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