Windows R2_NLB Load Balancing (detailed)

Source: Internet
Author: User
Tags servervariables

Directory

    • Directory
    • Load Balance
    • Using NLB to deploy a Web farm cluster
      • Environment preparation
      • Configuring the DNS service in WIN08R2PC1
      • Deploying File Service files services in WIN08R2PC1
      • Deploying IIS Web Services in WIN08R2PC1
      • Deploying IIS Web Services on WIN08R2PC2
      • Configure a shared site folder
        • Web Share configuration in WIN08R2PC1
        • Web Share configuration in WIN08R2PC2
      • Create an NLB cluster
    • Advanced Management for NLB
      • Edit port rules

Load Balance

Load Balance: Workload balancing provides an effective way to improve concurrent access for devices such as network devices, servers, and to ensure the flexibility and availability of network services.

lb principle : Allocate a large amount of data that a network service needs to deal with to perform on multiple operational units.

Using NLB to deploy a Web farm cluster

server cluster Cluster: With a cluster of ideas and methods to allow a large number of servers to support a service at the same time, the client looks like only one server is running. A cluster can use multiple computers for parallel computing to get a high computational speed, or it can use multiple computers to make backups, so that any one machine can break the whole system or run normally. Clustering operations can reduce the number of single points of failure and enable high availability of clustered resources.

NLB (Network Load Balance): A Web farm that consists of multiple IIS Web servers, providing a high-availability, error-free, load-balanced web site. When a Web farm receives a connection request from a number of different users, these requests are distributed to different Web servers in the Web farm for processing, which improves access efficiency. Web farm also has the capability of failover if a Web server in the Web farm fails to continue providing services because of a failure, and the other Web servers that still work can continue to serve the user.

Web Farm Architecture

    1. Each Web server in the Web farm has a static IP address for the external NIC. The server sends traffic externally through these static IPs.
    2. After you create an NLB Cluster that joins IIS WEB server to NLB Cluster, they share the same cluster IP address (the virtual IP address). And through this cluster IP address to accept the user's Internet request.
    3. When NLB accepts these requests, it balances these requests with the IIS WEB Server in NLB cluster. This achieves the goal of load balancing, enhancing the performance and availability of IIS WEB server.

Environment preparation

Prepare the server :

    • Win08r2_pc1

      • Hostname=win08r2pc1
      • Nic Int1=192.168.1.100/24 (STATICIP) \ nic int2= cluster IP (not set first)
      • DNS Service
      • IIS Web Service
      • Fileservice
    • Win08r2_pc2

      • Hostname=win08r2pc2
      • Nic Int1=192.168.1.200/24 (STATICIP) \ nic int2= cluster IP (not set first)
      • IIS Web Service
    • Win7_pc1

      • Hostname=win7pc1
      • IP = 192.168.1.222/24
    • Virtual network VMNet1, VMNet2
      • int1andint2 in WIN08R2PC1 and WIN08R2PC2 are respectively connected to Net1,Net2

Configure the above preparation environment and test for successful communication

Configuring the DNS service in WIN08R2PC1

Create a neishida.comand add a record (www.neishida.com <–> 192.168.1.8) to the domain
Note : 192.168.1.8 is the cluster IP, which is the target IP for which the user sends the request.

testing : Resolving www.neishida.com domain Names in WIN7PC1

Deploying File Service files services in WIN08R2PC1

File service is used to store shared settings and share Web page content for Web servers.
Step1: Create a new local security user in WIN08R2PC1 so that the Web service for both servers can use this account to connect to the file server.

start –> Administrative Tools –> Computer Management –> Local Users and Groups –> add new user webuser (cancel next login change password, select Password never expires)

STEP2: Create a new folder to hold shared configuration and Shared Site Web page files C:\\Webfiles and give users webuser Full Control permissions

Next, create two folders under shared folder WebFiles configurations and Contents are used to store shared profiles and Web page files, respectively.

Step3: The owner of the shared folder is set to WebUser, otherwise the profile cannot be accessed due to insufficient permissions.

Deploying IIS Web Services in WIN08R2PC1

Step1: Add the IIS Web Service role and set the use of ASP. NET for Web back-end support
STEP2: Change the site Welcome page to the highest priority of Default.aspx, can effectively improve the site's access efficiency.

Step3: %SystemDrive%\inetpub\wwwroot Create a Test Web page file default.aspxin the default site directory.
Write the following ASP code:

<b>客户端的IP地址为:</b><%Response.Write(Request.ServerVariables("remote_addr"))%><br><b>Web Server的IP地址是:<b><%Response.Write(Request.ServerVariables("local_addr"))%>

Step4: Access to the http://192.168.1.100 Test Web service in WIN7PC1 is working correctly.

Deploying IIS Web Services on WIN08R2PC2

The steps for deploying Web services on WIN08R2PC1 are approximately the same, but you do not need to write Default.aspx on WIN08R2PC2.
After the installation is complete, the http://192.168.1.200 Test Web service is running correctly on WIN7PC1.

Configure a shared site folder

We need to use shared Folders c:\Webfiles as a site folder for two Web servers together

Web Share configuration in WIN08R2PC1

Step1: Copy default.aspx files from WIN08R2PC1 to a shared folder c:\Webfiles\Contents

STEP2: Add the user webuser to the Iis_iusrs group.

Step3: Use the shared folder c:\Webfiles\Contents as the WIN08R2PC1 Web Service site folder.
Open Web site The basic settings for Default Web sites –> enter \192.168.1.100\webfiles\contents–> at the physical path click Connect as –> Set the specified access user for the site folder to WebUser

STEP4: Testing

After the configuration is complete, the shared site folder can only be accessed through user webuser, either in WIN08R2PC1 or in WIN08R2PC2.

Step5: Enter http://192.168.1.100 again in WIN7PC1 to access the site.

Step6: Configuring sharing settings for WEB1
The shared settings and keys for Web1 are exported to the shared folder first c:\Webfiles\configurations .
You need to use the credentials of the user webuser to do this, and you need to encrypt the location file.

Export key after entering key password

STEP7: Shared configuration function of enterprise Web1


At this point, the Web service key in WIN08R2PC1 is backed up to the local computer's %Systemroot%\System32\inetsrv\config folder.

STEP8: Restart the Web server for configuration to take effect

Web Share configuration in WIN08R2PC2

Step1: Create a user webuser with the same name in WIN08R2PC2 to access the shared site folder, and have webuser belong to the Iis_iusers group.

STEP2: Set the WIN08R2PC2 site directory to \\192.168.1.100\Webfiles\Contents

Step3: Enter the test in WIN7PC1 http://192.168.1.200 to have normal access to the WIN08R2PC2 Web service

Step4: Set site sharing settings in WIN08R2PC2

Step5: Restart the IIS Web service for configuration to take effect

Create an NLB cluster

Step1: Install the network in WIN08R2PC1 and WIN08R2PC2 to be responsible for the equalization function respectively.
Note : Each server that needs to be added to the cluster needs to have the NLB feature module installed.
Open Server Manager –> feature –> add features –> Network Load Balancing

STEP2: Create a new cluster in WIN08R2PC1
Start –> management tool –> Network Load average manager –> right-click Network Load Average cluster –> new cluster –> Enter host –> Click Connect –> Select Int1–> Next


Where the priority is the unique identifier of the host in the cluster HostID, each host can have only one priority.

Step3: Setting up Virtual ip:192.168.1.8

Step4: Selecting a unicast cluster mode

operation mode of the cluster :

    • Unicast mode: The MAC address of each server in the NLB cluster will be replaced with the same cluster MAC address . Each server receives a request to connect to the Web farm through the cluster MAC address.
    • Multicast mode: Multicast packets are delivered to multiple servers at the same time, which belong to the same multicast group, and they have a common multicast MAC address .

Step5: Click Done to use the default port rules

Step6: Waiting for NLB to aggregate WIN08R2PC1 into the cluster

Step7: Adding WIN08R2PC2 to an NLB cluster
In NLB Manager, right-click 192.168.1.8–> Select Add Host to cluster –> place WIN08R2PC2 IP address on host or hostname–> select Nic int1–> click Next

Priority defaults to 2

STEP8: Wait for WIN08R2PC2 aggregation to complete.

Step9: Accessing http://www.neishida.com test NLB in WIN7PC1 is working

Note : If there are 500 internal errors, you can try run–> to restart the iisreset IIS Web service.

Advanced administrative editing port rules for NLB

Cluster IP address : Select the cluster IP address that applies to this rule. This rule is applied by default for all cluster IP addresses.
Port range : The range of ports covered by this port rule.
Filter Mode :

    • Multiple hosts: Indicates that all servers in the cluster handle network requests that enter the cluster, together to provide Network Load balancing and troubleshooting capabilities. The load weighting for each server in the cluster is consistent by default. We can also set different load weights for each server by right-clicking the server name –> host properties –> port rules tab –> edit .
    • Single host: Indicates that the traffic associated with this rule is handled by a single server.
    • Disable this port range: All traffic associated with this port rule will be blocked by the NLB cluster.

Windows R2_NLB Load Balancing (detailed)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.