Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # Install and configure HAproxy on your lb-01 server
- sudo apt update -y
- sudo apt install haproxy -y
- echo "frontend main
- bind *:80
- mode http
- default_backend servers
- backend servers
- balance roundrobin
- server web-01 34.232.68.81:80 check
- server web-02 54.198.29.36:80 check
- " | sudo tee -a /etc/haproxy/haproxy.cfg
- echo "ENABLED=1" | sudo tee -a /etc/default/haproxy
- sudo systemctl restart haproxy
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement