SlideShare une entreprise Scribd logo
1  sur  17
LoadBalancing с Linux



 Какво е това нещо LoadBalancer


 Защо може да ми трябва подобно чудо




                                  </WebTech
LoadBalancing с Linux

    Видове LoadBalancing

 Service

 Server

 Network




                           </WebTech
LoadBalancing с Linux

    Service LoadBalancing

 Web server balancing

 Mail server balancing

 DataBase server balancing




                             </WebTech
LoadBalancing с Linux

DNS Round-robin
                                  1    2     3
+ clusters
+ SAN                    DNS    WEB   WEB WEB
+ друг вид Distributed
Network Storage          www.site.com address 1

                         www.site.com address 1
                         www.site.com address 2
                         www.site.com address 3

Кой използва тази технолагия?


                                       </WebTech
LoadBalancing с Linux

           Network LoadBalancing
Route (split access)

Route (multihomed)

Bonding(shared access)

Комбинация



                              </WebTech
LoadBalancing с Linux

             Route (spit access)
/etc/iproute2/rt_tables
   255    local         12   isp1
   254    main          13   isp2
   253    default
ip route add $LOCAL_NET dev $IF_LOCAL table isp1
ip route add $NET_ISP1 dev $IF_ISP1 table isp1
ip route add 0/0 via $GW_ISP1 table isp1

ip route add $LOCAL_NET dev $IF_LOCAL table isp2
ip route add $NET_ISP2 dev $IF_ISP2 table isp2
ip route add 0/0 via $GW_ISP2 table isp2

                                          </WebTech
LoadBalancing с Linux

               Route (spit access)
ip rule add from $IP_ISP1 table isp1
ip rule add from $IP_ISP2 table isp2

iptables -t nat -A POSTROUTING -j SNAT -s $LOCAL_IP 
–to $IP_ISP1

iptables -t nat -A POSTROUTING -j SNAT -s $LOCAL_IP 
–to $IP_ISP2




                                              </WebTech
LoadBalancing с Linux

               Route (multihomed)
ip route add 0/0 nexthop via $GW_ISP1 weight 1 
                 nexthop via $GW_ISP2 weight 2

ip rule add from fwmask 1 table isp1
ip rule add from fwmask 2 table isp2

iptables -A POSTROUTING -t nat -m mark --mark 1 -j SNAT
 --to $IP_ISP1
iptables -A POSTROUTING -t nat -m mark --mark 2 -j SNAT
 --to $IP_ISP2


                                               </WebTech
LoadBalancing с Linux

              Route (multihomed)

iptables -t mangle -A POSTROUTING -j MARK --set-mark 1
 -m state --state NEW -o $IF_ISP1
iptables -t mangle -A POSTROUTING -j MARK --set-mark 2
 -m state --state NEW -o $IF_ISP2

iptables -t mangle -A POSTROUTING -j CONNMARK 
--save-mark -m state --state NEW
iptables -t mangle -A PREROUTING -j CONNMARK 
--restore-mark


                                              </WebTech
LoadBalancing с Linux

         Route (multihomed)

patch-o-matic-ng (преди 12.05.2006)

  модули:
    random
    nth




                                      </WebTech
LoadBalancing с Linux

            Bonding (share load)

Какво е представлява

Какво може да прави

Настройки

Проблеми




                                   </WebTech
LoadBalancing с Linux

                Bonding (share load)
  Нужен софтуер

   # gcc -Wall -O -I/usr/src/linux/include ifenslave.c -o
ifenslave
   # cp ifenslave /sbin/ifenslave

  Настройки

     /etc/modules.conf     /etc/modprobe.conf



                                                    </WebTech
LoadBalancing с Linux

           Bonding (share load)
Monitoring
  arp_interval
  arp_ip_mon
  downdelay(ethernet)
  miimon

Пример
  alias bond0 bonding
  options bond0 mode=balance-alb miimon=100
        primary=eth0 updelay=50


                                        </WebTech
LoadBalancing с Linux

           Bonding (share load)
Type of bonding
  mode 0 или balance-rr
  mode 1 или active-backup
  mode 2 или balance-xor
  mode 3 или broadcast
  mode 4 или 802.3ad(link agregation)
  mode 5 или balance-tlb
  mode 6 или balance-alb




                                        </WebTech
LoadBalancing с Linux

          Bonding (share load)

Проблемите
  ограниченията на ethernet
  arp_interval & arp_ip_target
  missing interfaces




                                 </WebTech
LoadBalancing с Linux

          Комбинации

Bonding tunels за Българския трафик

Split access за Международният трафик

Проблемите




                                        </WebTech
LoadBalancing с Linux

    ?               ?               ?               ?               ?           ?
            ?                   ?           ?               ?
?       ?               ?                 ?                                 ?
    ?           ?                   ? Въпроси ?                         ?
?
            ?               ?           ?           ?           ?       ?
? ?                 ?           ?               ?           ?                   ?
 ? ?                    ?               ?           ?               ?       ?
?       ?           ?       ?               ?           ?       ?       ?
                                                                        </WebTech

Contenu connexe

Tendances

Building your own sdn with debian linux salt stack and python
Building your own sdn with debian linux salt stack and pythonBuilding your own sdn with debian linux salt stack and python
Building your own sdn with debian linux salt stack and python
Maximilan Wilhelm
 
flowspec @ APF 2013
flowspec @ APF 2013flowspec @ APF 2013
flowspec @ APF 2013
Tom Paseka
 
Chapter 03 configuring link aggregation and bridging
Chapter 03   configuring link aggregation and bridgingChapter 03   configuring link aggregation and bridging
Chapter 03 configuring link aggregation and bridging
dimuthur
 

Tendances (17)

Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
 
Operationalizing BGP in the SDDC
Operationalizing BGP in the SDDCOperationalizing BGP in the SDDC
Operationalizing BGP in the SDDC
 
Building your own sdn with debian linux salt stack and python
Building your own sdn with debian linux salt stack and pythonBuilding your own sdn with debian linux salt stack and python
Building your own sdn with debian linux salt stack and python
 
Huawei ARG3 Router How To - Troubleshooting OSPF: Router ID Confusion
Huawei ARG3 Router How To - Troubleshooting OSPF: Router ID ConfusionHuawei ARG3 Router How To - Troubleshooting OSPF: Router ID Confusion
Huawei ARG3 Router How To - Troubleshooting OSPF: Router ID Confusion
 
Cumulus Linux 2.5.4
Cumulus Linux 2.5.4Cumulus Linux 2.5.4
Cumulus Linux 2.5.4
 
flowspec @ APF 2013
flowspec @ APF 2013flowspec @ APF 2013
flowspec @ APF 2013
 
Ccna icnd2-labs exercices
Ccna icnd2-labs exercicesCcna icnd2-labs exercices
Ccna icnd2-labs exercices
 
Operationalizing VRF in the Data Center
Operationalizing VRF in the Data CenterOperationalizing VRF in the Data Center
Operationalizing VRF in the Data Center
 
Chapter 03 configuring link aggregation and bridging
Chapter 03   configuring link aggregation and bridgingChapter 03   configuring link aggregation and bridging
Chapter 03 configuring link aggregation and bridging
 
Install ovs on local pc
Install ovs on local pcInstall ovs on local pc
Install ovs on local pc
 
Huawei ARG3 Router How To - Troubleshooting OSPF: Netmask mismatch
Huawei ARG3 Router How To - Troubleshooting OSPF: Netmask mismatchHuawei ARG3 Router How To - Troubleshooting OSPF: Netmask mismatch
Huawei ARG3 Router How To - Troubleshooting OSPF: Netmask mismatch
 
Network Test Automation 2015-04-23 #npstudy
Network Test Automation 2015-04-23 #npstudyNetwork Test Automation 2015-04-23 #npstudy
Network Test Automation 2015-04-23 #npstudy
 
Contemporary Linux Networking
Contemporary Linux NetworkingContemporary Linux Networking
Contemporary Linux Networking
 
Network Jumbo Frame Config Guide
Network Jumbo Frame Config GuideNetwork Jumbo Frame Config Guide
Network Jumbo Frame Config Guide
 
Understanding Open vSwitch
Understanding Open vSwitch Understanding Open vSwitch
Understanding Open vSwitch
 
Apache Httpd and TLS certificates validations
Apache Httpd and TLS certificates validationsApache Httpd and TLS certificates validations
Apache Httpd and TLS certificates validations
 
OpenvSwitch Deep Dive
OpenvSwitch Deep DiveOpenvSwitch Deep Dive
OpenvSwitch Deep Dive
 

En vedette

Web Server Clustering - OSSCAMP
Web Server Clustering - OSSCAMPWeb Server Clustering - OSSCAMP
Web Server Clustering - OSSCAMP
Abhishek Singh
 
LOAD BALANCING ALGORITHMS
LOAD BALANCING ALGORITHMSLOAD BALANCING ALGORITHMS
LOAD BALANCING ALGORITHMS
tanmayshah95
 
Load Balancing
Load BalancingLoad Balancing
Load Balancing
nashniv
 

En vedette (8)

Web Server Clustering - OSSCAMP
Web Server Clustering - OSSCAMPWeb Server Clustering - OSSCAMP
Web Server Clustering - OSSCAMP
 
Rfc3261
Rfc3261Rfc3261
Rfc3261
 
Dell Boomi AtomSphere - A presentation by RapidValue Solutions
Dell Boomi AtomSphere  - A presentation by RapidValue SolutionsDell Boomi AtomSphere  - A presentation by RapidValue Solutions
Dell Boomi AtomSphere - A presentation by RapidValue Solutions
 
LOAD BALANCING ALGORITHMS
LOAD BALANCING ALGORITHMSLOAD BALANCING ALGORITHMS
LOAD BALANCING ALGORITHMS
 
Dell Boomi AtomSphere - iPaaS Document by RapidValue Solutions
Dell Boomi AtomSphere - iPaaS Document by RapidValue SolutionsDell Boomi AtomSphere - iPaaS Document by RapidValue Solutions
Dell Boomi AtomSphere - iPaaS Document by RapidValue Solutions
 
Load Balancing
Load BalancingLoad Balancing
Load Balancing
 
AWS 101: Cloud Computing Seminar (2012)
AWS 101: Cloud Computing Seminar (2012)AWS 101: Cloud Computing Seminar (2012)
AWS 101: Cloud Computing Seminar (2012)
 
Load balancing
Load balancingLoad balancing
Load balancing
 

Similaire à Load balancing with Linux

Tópicos - LVS Instalacao Slack11
Tópicos - LVS Instalacao Slack11Tópicos - LVS Instalacao Slack11
Tópicos - LVS Instalacao Slack11
Luiz Arthur
 

Similaire à Load balancing with Linux (20)

The Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitchThe Basic Introduction of Open vSwitch
The Basic Introduction of Open vSwitch
 
Fisl - Deployment
Fisl - DeploymentFisl - Deployment
Fisl - Deployment
 
[네이버오픈소스세미나] Maglev Hashing Scheduler in IPVS, Linux Kernel - 송인주
[네이버오픈소스세미나] Maglev Hashing Scheduler in IPVS, Linux Kernel - 송인주[네이버오픈소스세미나] Maglev Hashing Scheduler in IPVS, Linux Kernel - 송인주
[네이버오픈소스세미나] Maglev Hashing Scheduler in IPVS, Linux Kernel - 송인주
 
VMware ESXi - Intel and Qlogic NIC throughput difference v0.6
VMware ESXi - Intel and Qlogic NIC throughput difference v0.6VMware ESXi - Intel and Qlogic NIC throughput difference v0.6
VMware ESXi - Intel and Qlogic NIC throughput difference v0.6
 
OpenStack Neutron Dragonflow l3 SDNmeetup
OpenStack Neutron Dragonflow l3 SDNmeetupOpenStack Neutron Dragonflow l3 SDNmeetup
OpenStack Neutron Dragonflow l3 SDNmeetup
 
10 sdn-vir-6up
10 sdn-vir-6up10 sdn-vir-6up
10 sdn-vir-6up
 
DragonFlow sdn based distributed virtual router for openstack neutron
DragonFlow sdn based distributed virtual router for openstack neutronDragonFlow sdn based distributed virtual router for openstack neutron
DragonFlow sdn based distributed virtual router for openstack neutron
 
Deployment de Rails
Deployment de RailsDeployment de Rails
Deployment de Rails
 
Installation of pfSense on Soekris 6501
Installation of pfSense on Soekris 6501Installation of pfSense on Soekris 6501
Installation of pfSense on Soekris 6501
 
Tópicos - LVS Instalacao Slack11
Tópicos - LVS Instalacao Slack11Tópicos - LVS Instalacao Slack11
Tópicos - LVS Instalacao Slack11
 
Ethernet Bonding for Multiple NICs on Linux ~ A techXpress Guide
Ethernet Bonding for Multiple NICs on Linux ~ A techXpress GuideEthernet Bonding for Multiple NICs on Linux ~ A techXpress Guide
Ethernet Bonding for Multiple NICs on Linux ~ A techXpress Guide
 
Don't think about the difficulty Let's try to connect easy to IPv6 network w...
 Don't think about the difficulty Let's try to connect easy to IPv6 network w... Don't think about the difficulty Let's try to connect easy to IPv6 network w...
Don't think about the difficulty Let's try to connect easy to IPv6 network w...
 
Deployment with Ruby on Rails
Deployment with Ruby on RailsDeployment with Ruby on Rails
Deployment with Ruby on Rails
 
Webinar: Agile Network Deployment
Webinar: Agile Network DeploymentWebinar: Agile Network Deployment
Webinar: Agile Network Deployment
 
Network Performance: Making Every Packet Count - NET401 - re:Invent 2017
Network Performance: Making Every Packet Count - NET401 - re:Invent 2017Network Performance: Making Every Packet Count - NET401 - re:Invent 2017
Network Performance: Making Every Packet Count - NET401 - re:Invent 2017
 
Using Agilio SmartNICs for OpenStack Networking Acceleration
Using Agilio SmartNICs for OpenStack Networking AccelerationUsing Agilio SmartNICs for OpenStack Networking Acceleration
Using Agilio SmartNICs for OpenStack Networking Acceleration
 
Linux Kernel vs DPDK: HTTP Performance Showdown
Linux Kernel vs DPDK: HTTP Performance ShowdownLinux Kernel vs DPDK: HTTP Performance Showdown
Linux Kernel vs DPDK: HTTP Performance Showdown
 
Nic bonding
Nic bonding Nic bonding
Nic bonding
 
Scaling OpenStack Networking Beyond 4000 Nodes with Dragonflow - Eshed Gal-Or...
Scaling OpenStack Networking Beyond 4000 Nodes with Dragonflow - Eshed Gal-Or...Scaling OpenStack Networking Beyond 4000 Nodes with Dragonflow - Eshed Gal-Or...
Scaling OpenStack Networking Beyond 4000 Nodes with Dragonflow - Eshed Gal-Or...
 
22 - IDNOG03 - Christopher Lim (Mellanox) - Efficient Virtual Network for Ser...
22 - IDNOG03 - Christopher Lim (Mellanox) - Efficient Virtual Network for Ser...22 - IDNOG03 - Christopher Lim (Mellanox) - Efficient Virtual Network for Ser...
22 - IDNOG03 - Christopher Lim (Mellanox) - Efficient Virtual Network for Ser...
 

Plus de Marian Marinov

Plus de Marian Marinov (20)

How to implement PassKeys in your application
How to implement PassKeys in your applicationHow to implement PassKeys in your application
How to implement PassKeys in your application
 
Dev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & LoggingDev.bg DevOps March 2024 Monitoring & Logging
Dev.bg DevOps March 2024 Monitoring & Logging
 
Basic presentation of cryptography mechanisms
Basic presentation of cryptography mechanismsBasic presentation of cryptography mechanisms
Basic presentation of cryptography mechanisms
 
Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?Microservices: Benefits, drawbacks and are they for me?
Microservices: Benefits, drawbacks and are they for me?
 
Introduction and replication to DragonflyDB
Introduction and replication to DragonflyDBIntroduction and replication to DragonflyDB
Introduction and replication to DragonflyDB
 
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQMessage Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
Message Queuing - Gearman, Mosquitto, Kafka and RabbitMQ
 
How to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdfHow to successfully migrate to DevOps .pdf
How to successfully migrate to DevOps .pdf
 
How to survive in the work from home era
How to survive in the work from home eraHow to survive in the work from home era
How to survive in the work from home era
 
Managing sysadmins
Managing sysadminsManaging sysadmins
Managing sysadmins
 
Improve your storage with bcachefs
Improve your storage with bcachefsImprove your storage with bcachefs
Improve your storage with bcachefs
 
Control your service resources with systemd
 Control your service resources with systemd  Control your service resources with systemd
Control your service resources with systemd
 
Comparison of-foss-distributed-storage
Comparison of-foss-distributed-storageComparison of-foss-distributed-storage
Comparison of-foss-distributed-storage
 
Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?Защо и как да обогатяваме знанията си?
Защо и как да обогатяваме знанията си?
 
Securing your MySQL server
Securing your MySQL serverSecuring your MySQL server
Securing your MySQL server
 
Sysadmin vs. dev ops
Sysadmin vs. dev opsSysadmin vs. dev ops
Sysadmin vs. dev ops
 
DoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDKDoS and DDoS mitigations with eBPF, XDP and DPDK
DoS and DDoS mitigations with eBPF, XDP and DPDK
 
Challenges with high density networks
Challenges with high density networksChallenges with high density networks
Challenges with high density networks
 
SiteGround building automation
SiteGround building automationSiteGround building automation
SiteGround building automation
 
Preventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel trackingPreventing cpu side channel attacks with kernel tracking
Preventing cpu side channel attacks with kernel tracking
 
Managing a lot of servers
Managing a lot of serversManaging a lot of servers
Managing a lot of servers
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Load balancing with Linux

  • 1. LoadBalancing с Linux Какво е това нещо LoadBalancer Защо може да ми трябва подобно чудо </WebTech
  • 2. LoadBalancing с Linux Видове LoadBalancing Service Server Network </WebTech
  • 3. LoadBalancing с Linux Service LoadBalancing Web server balancing Mail server balancing DataBase server balancing </WebTech
  • 4. LoadBalancing с Linux DNS Round-robin 1 2 3 + clusters + SAN DNS WEB WEB WEB + друг вид Distributed Network Storage www.site.com address 1 www.site.com address 1 www.site.com address 2 www.site.com address 3 Кой използва тази технолагия? </WebTech
  • 5. LoadBalancing с Linux Network LoadBalancing Route (split access) Route (multihomed) Bonding(shared access) Комбинация </WebTech
  • 6. LoadBalancing с Linux Route (spit access) /etc/iproute2/rt_tables 255 local 12 isp1 254 main 13 isp2 253 default ip route add $LOCAL_NET dev $IF_LOCAL table isp1 ip route add $NET_ISP1 dev $IF_ISP1 table isp1 ip route add 0/0 via $GW_ISP1 table isp1 ip route add $LOCAL_NET dev $IF_LOCAL table isp2 ip route add $NET_ISP2 dev $IF_ISP2 table isp2 ip route add 0/0 via $GW_ISP2 table isp2 </WebTech
  • 7. LoadBalancing с Linux Route (spit access) ip rule add from $IP_ISP1 table isp1 ip rule add from $IP_ISP2 table isp2 iptables -t nat -A POSTROUTING -j SNAT -s $LOCAL_IP –to $IP_ISP1 iptables -t nat -A POSTROUTING -j SNAT -s $LOCAL_IP –to $IP_ISP2 </WebTech
  • 8. LoadBalancing с Linux Route (multihomed) ip route add 0/0 nexthop via $GW_ISP1 weight 1 nexthop via $GW_ISP2 weight 2 ip rule add from fwmask 1 table isp1 ip rule add from fwmask 2 table isp2 iptables -A POSTROUTING -t nat -m mark --mark 1 -j SNAT --to $IP_ISP1 iptables -A POSTROUTING -t nat -m mark --mark 2 -j SNAT --to $IP_ISP2 </WebTech
  • 9. LoadBalancing с Linux Route (multihomed) iptables -t mangle -A POSTROUTING -j MARK --set-mark 1 -m state --state NEW -o $IF_ISP1 iptables -t mangle -A POSTROUTING -j MARK --set-mark 2 -m state --state NEW -o $IF_ISP2 iptables -t mangle -A POSTROUTING -j CONNMARK --save-mark -m state --state NEW iptables -t mangle -A PREROUTING -j CONNMARK --restore-mark </WebTech
  • 10. LoadBalancing с Linux Route (multihomed) patch-o-matic-ng (преди 12.05.2006) модули: random nth </WebTech
  • 11. LoadBalancing с Linux Bonding (share load) Какво е представлява Какво може да прави Настройки Проблеми </WebTech
  • 12. LoadBalancing с Linux Bonding (share load) Нужен софтуер # gcc -Wall -O -I/usr/src/linux/include ifenslave.c -o ifenslave # cp ifenslave /sbin/ifenslave Настройки /etc/modules.conf /etc/modprobe.conf </WebTech
  • 13. LoadBalancing с Linux Bonding (share load) Monitoring arp_interval arp_ip_mon downdelay(ethernet) miimon Пример alias bond0 bonding options bond0 mode=balance-alb miimon=100 primary=eth0 updelay=50 </WebTech
  • 14. LoadBalancing с Linux Bonding (share load) Type of bonding mode 0 или balance-rr mode 1 или active-backup mode 2 или balance-xor mode 3 или broadcast mode 4 или 802.3ad(link agregation) mode 5 или balance-tlb mode 6 или balance-alb </WebTech
  • 15. LoadBalancing с Linux Bonding (share load) Проблемите ограниченията на ethernet arp_interval & arp_ip_target missing interfaces </WebTech
  • 16. LoadBalancing с Linux Комбинации Bonding tunels за Българския трафик Split access за Международният трафик Проблемите </WebTech
  • 17. LoadBalancing с Linux ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Въпроси ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? </WebTech