Ha of load balancer
-
Upload
dae-myung-kang -
Category
Documents
-
view
3.058 -
download
6
description
Transcript of Ha of load balancer
HA of Load Balancer for Small Company
Agenda • Why?
–DNS RoundRobin
• Dedicated Server in IDC
–Hardware L4
–Using VIP
• AWS
–Using EIP
Why? • Let’s see in beginner’s point of view.
– How to distribute clients’ requests.
CLIENT
CLIENT
CLIENT
CLIENT
Web Server
Web Server DB
Using DNS RR
Why? • Let’s see in beginner’s point of view.
– How to distribute clients’ requests.
– But If one web server dies, half requests will fail.
– And DNS RR needs lots of propagation time.
CLIENT
CLIENT
CLIENT
CLIENT
Web Server
Web Server DB
Using DNS RR
Load Balancer! • LB distributes clients’ requests.
CLIENT
CLIENT
CLIENT
CLIENT
Web
Web DB
Using Load Balancer
LB
Load Balancer! • LB distributes clients’ requests.
– If one web server dies, LB will get rid of failed server.
CLIENT
CLIENT
CLIENT
CLIENT
Web
Web DB
Using Load Balancer
LB
Load Balancer FAIL • If LB dies, It is critical disaster.
– So we need HA of Load Balancer.
CLIENT
CLIENT
CLIENT
CLIENT
Web
Web DB
Using Load Balancer
LB
How? • How to HA of LB
– It depends on your situation.
• Question?
– Where do you host your service?
• IDC, aws
• Let’s go to build.
Dedicated Server in IDC • Using Hardware L4
– Could your hosting service support Hardware L4
– Pros
• The easiest way to manage
– Cons
• Expensive solution.
• Using VIP
– With HAProxy or Nginx
Hardware L4 #1 • You can choose 2 types of solution.
• Using L4 as LB
CLIENT
CLIENT
CLIENT
CLIENT
Web
Web DB
Using Hardware L4 #1
L4
Hardware L4 #2 • Using L4 with LB
– Hardware L4 can fail, but rarely
CLIENT
CLIENT
CLIENT
CLIENT
Web
Web DB
Using Hardware L4 #2
L4 LB
LB
Using VIP • Virtual IP Address
Route
1.1.1.2 1.1.1.3 1.1.1.4
CLIENT 1.1.1.4
1.1.1.2
1.1.1.4 is VIP which is allocated 1.1.1.2
Using VIP • We can give VIP to other Server.
Route
1.1.1.2 1.1.1.3 1.1.1.4
CLIENT 1.1.1.4
1.1.1.4 is VIP which is allocated 1.1.1.2
Software LB with Keepalived • Virtual IP Address( HAProxy, Nginx doesn’t matter )
LB1 192.168.1.3
192.168.1.2
LB2 192.168.1.4
Haproxy keepalived
Haproxy keepalived
Web 192.168.1.10
Web 192.168.1.11
Web 192.168.1.12
DB 192.168.1.100
Software LB with Keepalived • But you have to check failover time.
LB1 192.168.1.3
192.168.1.2
LB2 192.168.1.4
Haproxy keepalived
Haproxy keepalived
Web 192.168.1.10
Web 192.168.1.11
Web 192.168.1.12
DB 192.168.1.100
Keepalived checks each other. And LB2 Keepalived reassign VIP to oneself.
Software LB with Keepalived • Link
– HAProxy with keepalived
• http://haproxy.1wt.eu/download/1.3/doc/architecture.txt
• http://andyleonard.com/2011/02/01/haproxy-and-keepalived-example-configuration/
• http://aaronwalrath.wordpress.com/2011/06/28/configure-haproxy-and-keepalived-for-load-balancing-and-reverse-proxy-on-red-hatscientificcentos-linux-56/
– Nginx with keepalived
• http://www.cyberciti.biz/faq/handling-nginx-failover-with-keepalived/
• http://evolution.voxeo.com/wiki/kb:swloadbalancingfailover
AWS • What are different from IDC
– You can’t use Hardware L4
– You can’t use multicast
– You can’t use VIP
• How?
– ELB( Elastic Load Balancer )
– EIP( Elastic IP )
ELB • Auto Scaling is possible.
• ELB doesn’t support Fixed IP.
CLIENT
CLIENT
CLIENT
CLIENT
EC2 Instance
EC2 Instance ELB
EIP • Elastic IP Address
• We can associate and release EIP like VIP
Weakness of ELB,EIP • Whenever we use it, we have to pay.
– It is external IP.
• And it is impossible to apply ELB,EIP in AWS internal networks.
How to Handle in AWS? • There is no Silver Bullet.
• DNS based Solution
– Using Dynamic DNS Server for internal Network.
– Using short TTL.
Thank you!