Download presentation
Presentation is loading. Please wait.
Published byArron Porter Modified over 9 years ago
1
Administrasi Server Load Balancing
2
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? Hanya membagi tugas kah? Pemisahan Web Server & Database Server apakah termasuk load balancing?
3
Load Balancing Load Balacing: Mendistribusikan Resource. Resource: Processor, Memory, Network, Storage On top of creating actions and responses, your processor also powers your operating system RAM overutilization is not as big a problem as CPU overconsumption but it can still cause significant performance impact Network for monitoring bandwidth with tools bwm-ng, ping, and traceroute Disk (storage) for monitoring disk usage with tools du and df
4
top
5
Prinsip Load balancing Primary principles: Split applications over a number of servers, balancing the load over a number of servers (such as separate web and database servers). Add specialist components to applications in order to balance the amount of processing needed for each application function, – Caching of common web site data, saving time on the collection of this data from disk, or the creation of this data from database entries, etc. Create additional servers that can collectively share the load, which can greatly increase the amount of processing power available to complete the tasks required by a server.
6
Perancangan Load Balancing Guiding Principles Understand your system Planning Monitoring and Testing
7
Topics Load Balancing Your Website Load Balancing Your Database Network Load Balancing
8
Load Balancing your Webiste Contoh kasus: Apache Apakah Apache yang terinstall sudah maksimal? Memaksimalkan Apache: - Disable Modul yang tidak dibutuhkan - Disabling DNS lookups - Compression
9
Load Balancing your Website
10
Distribute all incoming connections to your web site to a number of different web servers by using one or more load balancing servers. Reduce the overall load on the web servers, you also have good means of failover in case one of the web servers temporarily breaks down. The simplest setup requires at least two web servers and one load-balancing server.
11
Load Balancing your Website
12
Preparing the server Preparing the workers Testing the Load Balancer
13
Load Balancing your Website
14
Load Balancing your Database MySQL Cluster will depend on several nodes working together. One or more cluster management nodes to manage, configure, and oversee your cluster, one (though commonly several) data nodes on which to store your data, and one or more MySQL nodes (traditional MySQL servers) that execute SQL queries.
15
Load Balancing your Database
16
Sharing the workload Basic Routing Basic network connectivity testing Network Load Balancing
18
Round Robin Least Connection Source URI URL parameter Load Balancing Scheduling Algorithm
19
HTTP LOAD BALANCING DENGAN HAPROXY
20
Topologi
21
Konfigurasi HAProxy (1) Instalasi HAProxy −sudo apt-get install haproxy Enable haproxy – Buka file /etc/default/haproxy – Ubah bagian opsi ENABLED menjadi ENABLED=1 – Simpan perubahan Konfigurasi file /etc/haproxy/haproxy.cfg – Detail file konfigurasi ada di 3 slide selanjutnya
22
File Konfigurasi haproxy.cfg global log /dev/log local0 log /dev/log local1 notice user haproxy group haproxy daemon ……
23
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
24
File Konfigurasi haproxy.cfg (cont.) ……. listen webfarm 0.0.0.0:80 mode http stats enable stats uri /haproxy?stats balance roundrobin option httpclose option forwardfor server webserver1 10.34.8.22:80 check server webserver2 10.34.8.23:80 check nama load balancer IP/Port load balancer algoritma load balancing IP/Port webserver 1 IP/Port webserver 2
25
Konfigurasi HAProxy (2) Restart service haproxy – sudo service haproxy restart Catatan khusus : jika haproxy tidak dapat di-start/restart karena error socket binding, stop service apache2 – sudo service apache2 stop
26
Pengujian HAProxy Ubah isi file /var/www/html/index.html pada webserver1 – Webserver 1 Ubah isi file /var/www/html/index.html pada webserver2 – Webserver 2 Lakukan akses ke alamat load balancer lewat browser
27
Terima Kasih
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.