In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
There is an article about windows layer 7 load balancing. This time we will talk about layer 4 load balancing.
TCP/IP protocol family, the seventh layer is the application layer, the fourth layer is the transport layer. Layer 4 load balancing is mainly transformed through IP.
Some excellent layer 4 load balancing software, the speed can be close to the efficiency of hardware load balancing. Of course, the speed is still a little bit faster than other people's hardware, after all, the price is there, an F5, hundreds of thousands, hundreds of thousands, millions.
The weight of the fourth layer is compared with that of the seventh layer: excellence is fast and can sense the state of the cluster server. The disadvantage is that you can't sense the state of the application layer software, such as the IIS site is down, but if the server doesn't hang up, the converted traffic continues to flow into the server.
Now a lot of layer 4 load balancing software, I mean under the LINUNX server. If you use Windows, I suggest people eat their family buckets. Performance certainly cannot be maximized. But in terms of stability, maintainability or the whole family bucket is easy to use, save worry and effort.
If you buy a genuine Microsoft system, you can also make a phone call and ask an engineer to solve the problem for you. The premise is that you have to use a family bucket.
Common layer 4 load balancing software: LVS,NLB, there are other, temporarily can not remember, do not bother to check.
Let's talk about how to install NLB. Of course, I use an operating system with GUI. Generally speaking, LINUX doesn't install GUI, but I'm not used to the black box of window. I don't know how to use it yet. I'll use the one with GUI first.
Install the NBL feature
First of all, click Service Manager.
Click "next" until you check this.
Installation succeeded.
Every server that participates in NLB needs to be installed. Unlike ARR, ARR only needs to be installed on the forwarding server.
Here, as a demonstration, install NLB on three servers
Are
192.168.99.8192.168.99.10192.168.99.11 working principle
All requests are distributed to each NLB server, and then the NLB server processes its own request according to the algorithm.
So how are all requests distributed to each server, because they have a common IP. That is to say, each server has two IP.
Yes, each computer can have multiple IP addresses.
In the advanced options, you can add multiple IP addresses manually.
Set up a cluster
Open the network load balancing manager and create a new cluster
Click "next" until it is finished.
The server of 192.168.99.10192.168.99.20 follows the steps below.
Click "next" until it is finished.
The cluster is deployed.
When we look at the IP, you find that one more public IP,192.168.99.20 is the cluster IP.
After it has been built, let's try it for a while. After the trial run is successful, let's talk about some details of the configuration.
First of all, IIS needs to make some settings, because we will use the public IP for access, which is 192.168.99.20
Visit http://192.168.99.20/api/home/GetUserChat
Returned successfully.
Pressure testing
The old rule, now use VS2017 for stress testing, after that, talk about the details of the configuration is done.
The test was successful, but the problem was also quite obvious.
First, the data is indeed widely distributed to every server, and we can see that the size of the data received is the same 5.4Mbps.
Second, the size of the data sent is completely different, which means that the processing is different. We can clearly see that the server 192.168.99.10 does most of the work. CPU has risen to 94%, and sending packets has also reached 1.5Mbps.
Detailed configuration
It is obvious that the cluster configuration is not appropriate. Let's talk about the details.
Cluster operation mode:
Unicast: the MAC of all node servers will be changed to cluster MAC, and the source MAC will become cluster MAC when sending data. Disadvantages: the MAC table of the switch cannot bind the MAC to which port it belongs to, and all packets are broadcast, resulting in a traffic burden. All node servers have the same MAC and cannot communicate with each other. That is, the cluster node has the same IP and the same MAC address.
Multicast: the MAC of the node server is not modified, but one more cluster MAC is added for the dedicated node server, and the nodes can communicate with each other through the dedicated IP.
Single network card multicast, dual network card unicast. The dual network card can be set up as a private IP to solve the problem that unicast nodes can not communicate with each other.
Cluster port rules:
Filter mode:
Multiple hosts: all data is processed by multiple servers.
Single host: all data is processed by one server, and the server is selected according to the priority.
Disable this port range: disable the data on this port for processing.
In multi-host mode, correlation:
None: it is handled by the root algorithm of the load balancer and basically requests for average distribution.
Single: a request from the same client belongs to the original processing server.
Network: the allocation is determined according to the class C address range of IP. That is, requests from the same network segment will be assigned to a server.
Priority: all forwarding in the cluster is processed according to the port rules. If the port rules are not met, it will be handled by the server with the lowest priority.
Why did we start with 192.168.99.10 taking a lot of work because the port rules were not set up? let's reset the port rules and test them again.
Previous default settin
Configuration after reset
All right, let's go back to the pressure.
Network acceptance and transmission are more equal.
The number of requests accepted by each server is roughly equal.
150 per second. Consistent with the server data.
The load balancing is basically consistent with the expected effect.
The NLB cluster test is complete.
The above windows layer 4 load balancer _ detailed explanation of load balancer based on NLB is all the content shared by the editor to you. I hope I can give you a reference and support it.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.