Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Understand LVS load balancing cluster and its classification

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

The following brings you to understand the cluster and classification of LVS load balancing, hoping to give you some help in practical application. Load balancing involves many things, and there are not many theories. There are many books on the Internet. Today, we will use the accumulated experience in the industry to do an answer.

Key content 1: understand the cluster:

1. Why use cluster: the site (website) has higher and higher requirements for hardware performance, response speed, service stability, data reliability and so on. Cluster technology is used to integrate multiple ordinary CVMs to meet the needs of the site.

two。 What is cluster: a cluster is a collection of a large number of servers to meet the growing business needs of enterprises.

3. Cluster classification: load balancing (LB), high availability (HA), high performance (HPC)

1) load balancing: assign a large number of tasks to multiple server nodes.

2) High availability: provide 7X24 (uninterrupted) service to improve server stability.

3) High-performance computing: the whole multi-server hardware to complete a large number of computing tasks.

Key content 2: hierarchical structure of load balancing (typical three-tier):

The first layer: the load scheduler, which responds to and distributes client access requests, and is also the unified entry (VIP) of the cluster.

The second tier: server pool, made up of many servers, is a real service machine (RIP) that can scale the cluster.

The third layer: shared storage, maintain the consistency of services, provide data storage, save storage resources.

Focus 3: the working mode of the cluster:

1. Address translation (NAT): features high security, scheduler prone to performance bottlenecks and not easy to implement (companies generally do not use linux services as gateways); the way to handle traffic is that both ingress and egress pass through the scheduler.

2.IP tunnel (TUN): it is characterized by good performance, poor security and high cost. Only the ingress traffic passes through the scheduler, and the egress directly returns to the customer through the internet.

3. Direct routing (DR): characterized by good performance, high security and easy to implement, ingress traffic process scheduler, egress traffic is returned to customers from the routing switching network.

Key content 4: learn about LVS:

1.LB cluster can be implemented in two ways: software and hardware devices. Software implementation of LB cluster can use nginx direction agent, DNS polling, LVS, haproxy and so on; hardware implementation requires the purchase of load balancing equipment from various manufacturers.

2.LVS (Linux Virtual Service) is a linux kernel module developed and maintained by Zhang Wensong in China. It is a load balancing solution based on ip address and content request distribution. By default, it is integrated into the kernel module name ip_vs.

3.LVS common scheduling algorithms (how tasks are assigned): polling (RR), weighted polling (WRR), least join (LC), weighted least join (WLC).

4.ipvsadm management tools:

1) LVS is divided into kernel mode (ip_vs) and user mode (ipvsadm). Ipvsadm is used to schedule ip_vs module to manage tasks such as adding, deleting, viewing and modifying node servers.

2) ipvsadm management cluster: (note that you need to manually install ipvsadm and load ip_vs modules)

Ipvsadm-A-t VIP:80-s scheduling algorithm # # VIP is a cluster IP,-A to add cluster IP, that is, VIP,-D delete VIP,-lc to view the configuration; scheduling algorithms include rr polling and minimum lc connections

3) ipvsadm manages cluster nodes:

Ipvsadm-a-t VIP:80-r real server ip:80-m-w weight # #-an add real service instead of-d delete real service,-t specify cluster ip;-m means cluster mode is NAT, if-g means DR mode,-I means TUN

4) Management of cluster rules:

/ etc/init.d/ipvsadm save # # Save cluster rules

Chkconfig ipvsadm on # # set boot application rules

After reading the above about understanding LVS load balancing cluster and classification, if you have anything else you need to know, you can find out what you are interested in in the industry information or find our professional and technical engineer to answer, the technical engineer has more than ten years of experience in the industry.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report