Академический Документы
Профессиональный Документы
Культура Документы
Disusun oleh :
Achmad Gunawan
1844370006
Load Balancing
• Load balancing means the ability to spread the load of
processing for an application over a number of
separate systems for an overall performance increase
in processing incoming requests.
• Simple?
• Enable haproxy
– Buka file /etc/default/haproxy
– Ubah bagian opsi ENABLED menjadi ENABLED=1
– Simpan perubahan
……
File Konfigurasi haproxy.cfg (cont.)
…….
defaults
log global
mode http
option httplog
option dontlognull
contimeout 5000
clitimeout 50000
srvtimeout 50000
errorfile 400 /etc/haproxy/errors/400.http
errorfile 403 /etc/haproxy/errors/403.http
errorfile 408 /etc/haproxy/errors/408.http
errorfile 500 /etc/haproxy/errors/500.http
errorfile 502 /etc/haproxy/errors/502.http
errorfile 503 /etc/haproxy/errors/503.http
File Konfigurasi haproxy.cfg (cont.)
…….
nama load balancer
IP/Port load balancer
listen webfarm 0.0.0.0:80
mode http
stats enable
stats uri /haproxy?stats algoritma load
balancing
balance roundrobin
option httpclose
IP/Port webserver 1
option forwardfor
server webserver1 10.34.8.22:80 check
server webserver2 10.34.8.23:80 check
IP/Port webserver 2
Konfigurasi HAProxy (2)
• Restart service haproxy
– sudo service haproxy restart