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

LVS load balancing

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

Focus 1: Understanding clusters:

1. Why cluster: The requirements for hardware performance, response speed, service stability, data reliability, etc. are getting higher and higher at the site (website), and multiple common servers are integrated through cluster technology to meet the needs of the site.

2. What is a cluster: A cluster is a collection of large numbers of servers created to accommodate the growing business needs of an enterprise.

3. Cluster classification: Load Balancer (LB), High Availability (HA), High Performance (HPC)

1) Load Balancer: Distribute 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 entire multi-server hardware completes a large number of computing tasks.

Highlight 2: Hierarchical structure of Load Balancer (typical three layers):

Layer 1: Load scheduler, responsible for responding to and distributing client access requests, is also the unified entry point (VIP) of the cluster.

The second layer: server pool, composed of many servers, is a machine that provides real services (RIP), which can achieve cluster scaling.

Layer 3: Shared storage, maintaining service consistency, providing data storage, and saving storage resources.

Focus 3: Cluster mode of operation:

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 traffic is processed is that both ingress and egress pass through the scheduler.

IP Tunneling (TUN): 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 implementation, ingress traffic process scheduler, egress traffic from the routing switch network back to the customer.

Focus 4: Understanding LVS:

1. LB cluster can be implemented in two ways: software and hardware. The LB cluster can be implemented by software using nginx directional proxy, DNS polling, LVS, haproxy, etc.; the hardware implementation requires the purchase of Load Balancer equipment from various manufacturers.

2. LVS (Linux Virtual Service) is a Linux kernel module, developed and maintained by Zhang Wensong of our country. It is a Load Balancer solution based on ip address and content request distribution. It is integrated into the kernel by default. The module name ip_vs of the kernel.

3. LVS common scheduling algorithms (way of assigning tasks): round robin (RR), weighted round robin (WRR), least connection (LC), weighted least connection (WLC).

4. ipvsadm administration tool:

1) LVS is divided into kernel mode (ip_vs) and user mode (ipvsadm). ipvsadm is used to dispatch ip_vs module to realize management 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 module)

ipvsadm -A -t VIP:80 -s Scheduling algorithm ##VIP is cluster IP, -A Add cluster IP i.e. VIP, -D Delete VIP, -lc View configuration; Scheduling algorithms include rr polling, lc Least connected

3) ipvsadm manages cluster nodes:

ipvsadm -a -t VIP:80 -r real server ip:80 -m -w weight ##-a add real service replaced by-d delete real service, -t specifies cluster ip;-m indicates cluster mode is NAT, if-g indicates DR mode, -i indicates TUN

4) Management of cluster rules:

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

chkconfig ipvsadm on ##Set boot apply rules

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