Due to the company’s recent surge in website traffic the number of connections to a single server often exceeds 2W in order to allow users to obtain better performance and For the disaster-tolerant website configuring load balancing (load balancing NLB) has also become the primary task. The company's server is the English version of Windows 2003 and two servers are used to configure load balancing.
After looking at Google and Baidu for 2 days I found that some load balancing (load balancing NLB) configuration experience is quite good so I will extract these excerpts and make memos and hope to Help more people configure.
Overview of Network Load Balancing (Network Load Balancing NLB Cluster)
First of all let's first understand the load balancing (load balancing) that comes with Windows2003\u0026mdash;\u0026mdash;NetworkLoadBalancing for short NLB. NLB is a cluster that integrates high availability high reliability and high scalability. It can not only realize load balancing but also realize various forms of redundancy. NLB is mainly used in environments where the files are not changed much and are not resident in memory such as WEB services FTP services and VPN services. NLB is not suitable for database mail and other services because there is no guarantee that the data of each node is the same.
When a user accesses the cluster the cluster can allocate the access request to each server in the cluster to achieve the effect of load balancing. These servers are called cluster nodes. In load balancing (load balancing NLB) the files of each node are generally required to be the same. In this way the results returned by each node to the customer are consistent. Generally speaking the establishment of an NLB requires at least two nodes one of which cannot be used and the entire load will fall on the remaining node that is full load. Windowsserver2003 supports up to 32 nodes. The more nodes the higher the availability and reliability.
NLB can provide three redundancy functions software redundancy hardware redundancy and site redundancy.
Working principle of network load balancing (network load balancing NLB cluster)
Every NLB node has the same virtual IP address. When an access request is sent to the virtual IP NLB will be responsible for routing the request to one of the nodes in order to achieve load balancing. As shown in the figure:
Next start to configure the NLB test site. Assume that the website is web.gooduck.com. Prepare two servers server1 and server2 install windowsserver2003Enterprise and install IIS components respectively.
Under the description here DNS resolution web.goodluck.com It is 126.96.36.199 (test address not real). When visiting web.goodluck.com NLB will route the request to 192.168.10.20 or 192.168.10.21 and they will handle the request. The whole process is like 188.8.131.52 return processing result. The user is not aware of the process.
Configuration of network load balancing (network load balancing NLB cluster) test site
1. Configure IIS service of vir20 and vir21
in each server Enter inetmgr in run
Create a default.htm file in DefaultWebSite and enter: Helloworld!
Right click and select\u0026rdquo;Browse\u0026rdquo;Browse results
Two servers Both perform the same operation.
Network load balancing (network load balancing NLB cluster) through a single node configuration method
There are two configuration methods for network load balancing:
One It is by configuring the connection properties of each node;
One is by NetworkLoadBalancingManager (new feature of windowsserver2003).
These two methods have their own strengths but I personally recommend the first method
The configuration method for a single node of network load balancing (network load balancing NLB cluster) is as follows:
Open the node connection properties and check NetworkLoadBalancing.
Click Properties to further set up
In the ClusterParameters page enter the virtual IP address 184.108.40.206 DNS resolution web.goodluck.com is this address.
In a node with a single network card only multicast can be used to send and receive internal IP streams and NLB streams. In the case of two network cards unicast can be used so that one network card is responsible for NLB flow and the other is responsible for IP flow. So in terms of access performance the unicast method is faster than the multicast method. Many servers today have two network ports. If the conditions are met it is best to use unicast mode.
Go to the HostParameters page.
Priority is set to 1 this node is the master node in the cluster. It shows that network load balancing (network load balancing NLB cluster) will first route the request to the node with higher priority when the load limit is not reached. The value at another node cannot be 1. Please note that this value is unique on each node. Enter the IP address of the node.
You can filter traffic. Indicates that any access to the 80 port is accepted. Accept specific IP for s443 port. If you want to add other rules click Add.
You can also set the load of the node and the default selection is balanced.
Affinity (Affinity) This is used to control access request routing. When using None requests from the same IP will get responses from different nodes which improves the performance of the cluster. If Protocols use UDP or Both in order to handle IP fragments correctly you should try not to use None. It is recommended to select None when processing to improve performance. Single mode routes from the same IP address to the same node improving the high security of access. The ClassC mode routes the visits from the same subnet as the node to the same node.
Next add a virtual IP to the TCP/IP of the node.
Click OK to complete the NLB settings.
After setting up both servers test it.
Browse web.goodluck.com on the client. Note that web.goodluck.com must be correctly parsed on the client.
You can modify the hosts file and add analysis manually. But it must be able to connect with the node.
Let’s consider again if one of the nodes cannot be accessed whether browsing will be affected.
Stop a IIS of server1 to test it. Modify the default.htm content of server1 and server2 to 'Helloworld!' TheIISofvir20isstopped.\u0026rdquo;
It can be seen that vir21 has undertaken all the visits.
Next turn on vir20 and turn off vir21. See what happens. Also modify the defualt.htm files of these two units. \u0026ldquo;Helloworld!TheIISofvir20isworkingnow.\u0026rdquo;
When vir21 stops working and vir20 works normally Network load balancing (network load balancing NLB cluster) still works normally. In this way the requirement of balanced load is reached.
Let's do a simple test below. If the contents of the two nodes vir20 and vir21 are different what will be the display result.
Modify the content of default.htm in vir20 as: \u0026rsquo;HelloWorld!Hereisvir20\u0026rsquo;.
The default.htm content of vir21 is: \u0026rsquo;HelloWorld!Hereisvir21\u0026rsquo;.
Note: The priority of vir21 is 1 and the priority of vir20 is 2.
IIS services of Vir20 and vir21 are working normally. Browse web.goodluck.com and find that IE displays the results
shows two results.
Refresh at intervals the results will also change. This test shows that NLB routes access requests to different nodes.
In order for visitors to get the correct results we must ensure that the files accessed must be the same. Here you can use the distributed file system (DistributedFileSystem) to synchronize files. It will be posted on my blog soon.
Network load balancing (network load balancing NLB cluster) configuration method through NetworkLoadBalancingManager
The second configuration method of network load balancing (network load balancing NLB