SlideShare a Scribd company logo
HA of Load Balancer
 for Small Company
          charsyam@naver.com
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.
                         Using DNS RR
       CLIENT
       CLIENT             Web Server
                                            DB
       CLIENT             Web Server
       CLIENT
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.
                          Using DNS RR
       CLIENT
       CLIENT              Web Server
                                                       DB
       CLIENT              Web Server
       CLIENT
Load Balancer!
• LB distributes clients’ requests.

                    Using Load Balancer
       CLIENT
       CLIENT                    Web
                        LB                DB
       CLIENT                    Web
       CLIENT
Load Balancer!
• LB distributes clients’ requests.
   – If one web server dies, LB will get rid of failed server.

                    Using Load Balancer
     CLIENT
     CLIENT                        Web
                         LB                          DB
     CLIENT                        Web
     CLIENT
Load Balancer FAIL
• If LB dies, It is critical disaster.
   – So we need HA of Load Balancer.
                     Using Load Balancer
        CLIENT
        CLIENT                     Web
                          LB               DB
        CLIENT                     Web
        CLIENT
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
                 Using Hardware L4 #1
   CLIENT
   CLIENT                     Web
                      L4                DB
   CLIENT                     Web
   CLIENT
Hardware L4 #2
• Using L4 with LB
  – Hardware L4 can fail, but rarely

                 Using Hardware L4 #2
   CLIENT
   CLIENT                   LB         Web
                L4                           DB
   CLIENT                   LB         Web
   CLIENT
Using VIP
• Virtual IP Address
                                      CLIENT
                                             1.1.1.4
                                      Route
                                         1.1.1.2
                       1.1.1.2                          1.1.1.3
                        1.1.1.4
                       1.1.1.4 is VIP which is allocated 1.1.1.2
Using VIP
• We can give VIP to other Server.
                                   CLIENT
                                          1.1.1.4
                                   Route

                   1.1.1.2                           1.1.1.3
                                                      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 )


      192.168.1.2                  Web Web
       LB1 LB2                     192.168.1.10   192.168.1.11

      192.168.1.3
     Haproxy
                     192.168.1.4
                    Haproxy
                                   Web DB
     keepalived     keepalived     192.168.1.12   192.168.1.100
Software LB with Keepalived
• But you have to check failover time.


                         192.168.1.2   Web Web
       LB1 LB2                         192.168.1.10   192.168.1.11

      192.168.1.3
     Haproxy
                         192.168.1.4
                        Haproxy
                                       Web DB
     keepalived         keepalived     192.168.1.12   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                   EC2 Instance
                     ELB
         CLIENT                   EC2 Instance
         CLIENT
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!

More Related Content

PPTX
IP Multicast on ec2
PDF
[AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
PPTX
Building Micro-Services with Scala
PDF
Ansible & Cumulus Networks - Simplify Network Automation
PDF
The best of Apache Kafka Architecture
PPTX
Kafka Tutorial: Streaming Data Architecture
PDF
Serverless in Java Lessons learnt
PDF
Exactly-once Semantics in Apache Kafka
IP Multicast on ec2
[AWS Dev Day] 실습워크샵 | Amazon EKS 핸즈온 워크샵
Building Micro-Services with Scala
Ansible & Cumulus Networks - Simplify Network Automation
The best of Apache Kafka Architecture
Kafka Tutorial: Streaming Data Architecture
Serverless in Java Lessons learnt
Exactly-once Semantics in Apache Kafka

What's hot (18)

PPTX
Distributed automation sel_conf_2015
PDF
[En] IPVS for Docker Containers
PDF
OSv presentation from Linux Foundation Collaboration Summit
PPTX
Distributed automation selcamp2016
PPTX
Autoscaled Distributed Automation Expedia Know How
PDF
Spinnaker 파트 1
PDF
NetflixOSS meetup lightning talks and roadmap
PPTX
No Surprises Geo Replication - Pulsar Virtual Summit Europe 2021
PPTX
Kafka Tutorial: Kafka Security
PDF
Kubernetes "Ubernetes" Cluster Federation by Quinton Hoole (Google, Inc) Huaw...
PDF
10 Lessons Learned from using Kafka in 1000 microservices - ScalaUA
PPTX
Apache Bookkeeper and Apache Zookeeper for Apache Pulsar
PDF
[AWS Dev Day] 이머징 테크 | Libra 소스코드분석 및 AWS에서 블록체인 기반 지불 시스템 최적화 방법 - 박혜영 AWS 솔...
PPTX
Scala at Netflix
PDF
Integrating Puppet with Cloud Infrastructures-Remco Overdijk
PDF
Wido den hollander cloud stack and ceph
PPTX
Serverless
PDF
Adopting Java for the Serverless world at JUG Hamburg
Distributed automation sel_conf_2015
[En] IPVS for Docker Containers
OSv presentation from Linux Foundation Collaboration Summit
Distributed automation selcamp2016
Autoscaled Distributed Automation Expedia Know How
Spinnaker 파트 1
NetflixOSS meetup lightning talks and roadmap
No Surprises Geo Replication - Pulsar Virtual Summit Europe 2021
Kafka Tutorial: Kafka Security
Kubernetes "Ubernetes" Cluster Federation by Quinton Hoole (Google, Inc) Huaw...
10 Lessons Learned from using Kafka in 1000 microservices - ScalaUA
Apache Bookkeeper and Apache Zookeeper for Apache Pulsar
[AWS Dev Day] 이머징 테크 | Libra 소스코드분석 및 AWS에서 블록체인 기반 지불 시스템 최적화 방법 - 박혜영 AWS 솔...
Scala at Netflix
Integrating Puppet with Cloud Infrastructures-Remco Overdijk
Wido den hollander cloud stack and ceph
Serverless
Adopting Java for the Serverless world at JUG Hamburg
Ad

Viewers also liked (11)

PDF
IP Multicast Explained
PPTX
IP Multicasting
PPTX
Speeding up delivery of web content using Amazon Route 53, Elastic Load Balan...
PDF
Redis & Redis HA design with Keepalived
PPT
Ip multicast
PPTX
IP Multicasting
PDF
Redis High availability and fault tolerance in a multitenant environment
PDF
Redis modules 101
PDF
High Availability for OpenStack
PPT
Multicast Routing Protocols
PDF
Disaster Recovery using AWS -Architecture blueprints
IP Multicast Explained
IP Multicasting
Speeding up delivery of web content using Amazon Route 53, Elastic Load Balan...
Redis & Redis HA design with Keepalived
Ip multicast
IP Multicasting
Redis High availability and fault tolerance in a multitenant environment
Redis modules 101
High Availability for OpenStack
Multicast Routing Protocols
Disaster Recovery using AWS -Architecture blueprints
Ad

Similar to Ha of load balancer (20)

PPTX
MCSA 70-412 Chapter 09
PDF
Как сделать высоконагруженный сервис, не зная количество нагрузки / Олег Обле...
PDF
A Tale of 2 Systems
PPTX
Lync Server 2010: High Availability [I3004]
PDF
Network Functions Virtualization and CloudStack
PDF
Escalando Foursquare basado en Checkins y Recomendaciones
PPTX
Network load balancing deep dive
PDF
Scaling Social Games
PDF
Apache Zeppelin & Cluster
PDF
Web Clients for Ruby and What they should be in the future
PPTX
Inside Wordnik's Architecture
PPTX
NIC - Understand how Lync integrates with Exchange - Level 300
PPTX
Ståle Hansen - Understand how lync integrates with exchange
PPTX
CoAP Talk
PPTX
Performance out
PDF
7_OPEN17_Azure_Next-gen Development with PaaS & Containers
PPTX
Micro Services Architecture
PDF
Amazon Web Services Building Blocks for Drupal Applications and Hosting
PDF
High Performance WordPress II
PDF
Fast is good
MCSA 70-412 Chapter 09
Как сделать высоконагруженный сервис, не зная количество нагрузки / Олег Обле...
A Tale of 2 Systems
Lync Server 2010: High Availability [I3004]
Network Functions Virtualization and CloudStack
Escalando Foursquare basado en Checkins y Recomendaciones
Network load balancing deep dive
Scaling Social Games
Apache Zeppelin & Cluster
Web Clients for Ruby and What they should be in the future
Inside Wordnik's Architecture
NIC - Understand how Lync integrates with Exchange - Level 300
Ståle Hansen - Understand how lync integrates with exchange
CoAP Talk
Performance out
7_OPEN17_Azure_Next-gen Development with PaaS & Containers
Micro Services Architecture
Amazon Web Services Building Blocks for Drupal Applications and Hosting
High Performance WordPress II
Fast is good

More from DaeMyung Kang (20)

PPTX
Count min sketch
PDF
PDF
Ansible
PDF
Why GUID is needed
PDF
How to use redis well
PPTX
The easiest consistent hashing
PDF
How to name a cache key
PDF
Integration between Filebeat and logstash
PDF
How to build massive service for advance
PDF
Massive service basic
PDF
Data Engineering 101
PDF
How To Become Better Engineer
PPTX
Kafka timestamp offset_final
PPTX
Kafka timestamp offset
PPTX
Data pipeline and data lake
PDF
Redis acl
PDF
Coffee store
PDF
Scalable webservice
PDF
Number system
PDF
webservice scaling for newbie
Count min sketch
Ansible
Why GUID is needed
How to use redis well
The easiest consistent hashing
How to name a cache key
Integration between Filebeat and logstash
How to build massive service for advance
Massive service basic
Data Engineering 101
How To Become Better Engineer
Kafka timestamp offset_final
Kafka timestamp offset
Data pipeline and data lake
Redis acl
Coffee store
Scalable webservice
Number system
webservice scaling for newbie

Ha of load balancer

  • 1. HA of Load Balancer for Small Company charsyam@naver.com
  • 2. Agenda • Why? –DNS RoundRobin • Dedicated Server in IDC –Hardware L4 –Using VIP • AWS –Using EIP
  • 3. Why? • Let’s see in beginner’s point of view. – How to distribute clients’ requests. Using DNS RR CLIENT CLIENT Web Server DB CLIENT Web Server CLIENT
  • 4. 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. Using DNS RR CLIENT CLIENT Web Server DB CLIENT Web Server CLIENT
  • 5. Load Balancer! • LB distributes clients’ requests. Using Load Balancer CLIENT CLIENT Web LB DB CLIENT Web CLIENT
  • 6. Load Balancer! • LB distributes clients’ requests. – If one web server dies, LB will get rid of failed server. Using Load Balancer CLIENT CLIENT Web LB DB CLIENT Web CLIENT
  • 7. Load Balancer FAIL • If LB dies, It is critical disaster. – So we need HA of Load Balancer. Using Load Balancer CLIENT CLIENT Web LB DB CLIENT Web CLIENT
  • 8. 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.
  • 9. 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
  • 10. Hardware L4 #1 • You can choose 2 types of solution. • Using L4 as LB Using Hardware L4 #1 CLIENT CLIENT Web L4 DB CLIENT Web CLIENT
  • 11. Hardware L4 #2 • Using L4 with LB – Hardware L4 can fail, but rarely Using Hardware L4 #2 CLIENT CLIENT LB Web L4 DB CLIENT LB Web CLIENT
  • 12. Using VIP • Virtual IP Address CLIENT 1.1.1.4 Route 1.1.1.2 1.1.1.2 1.1.1.3 1.1.1.4 1.1.1.4 is VIP which is allocated 1.1.1.2
  • 13. Using VIP • We can give VIP to other Server. CLIENT 1.1.1.4 Route 1.1.1.2 1.1.1.3 1.1.1.4 1.1.1.4 is VIP which is allocated 1.1.1.2
  • 14. Software LB with Keepalived • Virtual IP Address( HAProxy, Nginx doesn’t matter ) 192.168.1.2 Web Web LB1 LB2 192.168.1.10 192.168.1.11 192.168.1.3 Haproxy 192.168.1.4 Haproxy Web DB keepalived keepalived 192.168.1.12 192.168.1.100
  • 15. Software LB with Keepalived • But you have to check failover time. 192.168.1.2 Web Web LB1 LB2 192.168.1.10 192.168.1.11 192.168.1.3 Haproxy 192.168.1.4 Haproxy Web DB keepalived keepalived 192.168.1.12 192.168.1.100 Keepalived checks each other. And LB2 Keepalived reassign VIP to oneself.
  • 16. 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
  • 17. 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 )
  • 18. ELB • Auto Scaling is possible. • ELB doesn’t support Fixed IP. CLIENT CLIENT EC2 Instance ELB CLIENT EC2 Instance CLIENT
  • 19. EIP • Elastic IP Address • We can associate and release EIP like VIP
  • 20. 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.
  • 21. How to Handle in AWS? • There is no Silver Bullet. • DNS based Solution – Using Dynamic DNS Server for internal Network. – Using short TTL.