Introduction to load Balancing clusters
LVS Introduction
Advantage: In NAT mode, only the Distributor has a public IP, the Distributor and RS can communicate with the intranet, so it is more economical to save public IP resources.
Disadvantage: The dispatcher becomes a bottleneck and the request volume cannot be too large. The scale is maintained at about 10 units.
We can imagine a virtual channel set up between the dispenser and each Rs.
This mode requires a common IP configuration on the Distributor and all RS, we call it VIP,
The principle is that the client requests the target IP for the VIP, the dispatcher receives the request packet, will make a completion of the packet, the target IP will be changed from VIP to RS IP, so that the packet on the RS.
After the RS accepts the packet, it restores the original packet so that the target IP is VIP, because all RS is configured with such a VIP, so it will be considered to be its own.
Nat mode iptables forwarding, IP tunneling has made a change to the destination IP, Dr Mode and IP tunneling similar, different point Dr Change is MAC address
The scheduling algorithm of LVS
4 Common types of
Polling: Round-robin RR (Task-balanced distribution to RS)
Weighted polling: Weight Round-robin WRR (with weighted polling, such as an RS configuration, you can set it to a higher weight)
Minimum connection: least-connection LC (send New task to RS with few requests)
Weighted minimum connection: Weight least-connection WLC (minimum connection with weight)
4 kinds of infrequently used
Minimum connection based on locality: locality-based Least Connections LBLC
Local least-link with replication: locality-based Least Connections with Replication LBLCR
Destination Address hash schedule: Destination Hashing DH
Source Address hashing schedule: source Hashing sh
LVS NAT Mode Setup
Linux cluster architecture