Recycling DNS to achieve load balancing of multiple servers

  

1 Overview

The increase in corporate visibility and the increasing number of website visits are expected by every network administrator. But at the same time, the application server's data traffic and traffic will increase exponentially, and the server will be overwhelmed.

At this time, there are two ways to solve this problem. One is to upgrade the hardware and purchase a server with higher configuration and better performance. The advantage of this method is that it is simple and easy, and the disadvantage is that the investment is large. It will cause waste of existing resources, and the next business volume will face the same problem. Another method is to use cluster technology to use two or more servers to work together. The servers running in the cluster system are not necessarily high-end products (can be the existing servers of the enterprise), but the clusters of the servers can provide comparable High-performance non-stop services; in addition, as the volume of business increases, the number of servers running in the cluster system can be increased at any time. The advantages of clustering technology are high reliability and powerful and flexible system expansion capabilities.

The work of two or more servers involuntarily involves load balancing. Currently, the commonly used load balancing technologies include: NAT load balancing, reverse proxy load balancing, and DNS load.

NAT load balancing maps an external IP address to multiple internal IP addresses, dynamically translates each connection request into an internal server address, and directs the external connection request to the server that translates the address. [1]. Reverse proxy load balancing uses a proxy server to forward requests to an internal web server, allowing the proxy server to evenly forward requests to one of multiple internal web servers for load balancing purposes [2]. DNS load balancing configures the same name for multiple addresses in DNS, allowing different clients to access different servers for load balancing. This article will detail the principles and technical implementation of DNS load balancing.

2 DNS load balancing principle

DNS load balancing is achieved through round-robin multiplexing. If multiple address resource records of the host name are found, it can be used cyclically for inclusion in the query response. Host resource record. By default, the DNS server's service uses round-robin to sort resource records that are returned in hostname responses that resolve to multiple maps. This feature provides a very simple way to load balance client-side Web servers and other frequently queried multi-homed machines.

For loop multiplexing to work properly, you must first register multiple host resource records for the queried name in the region and enable DNS server round-robin multiplexing. If the DNS server prohibits round robin multiplexing, the response order of these queries is based on the static ordering of the resource records in the answer list when stored in the region.

3 Load Balancing Instances for Four Servers

Services Available: Web, Ftp System Implementation Purpose: To make a more complete load balancing system to share and efficiently utilize resource devices Status: Five servers, four of which form a cluster system with IP addresses of 172.28.20.1, 172.28.20.2, 172.28.20.3, and 172.28.20.4, respectively;

One server acts as a control management server, providing DNS Service, set the enterprise domain name to www.example.com.cn.

Server configuration: Cluster system server installation Windows 2000 sever, Internet Information Service component must be installed;

DNS server installation Windows 2000 sever, DNS component must be installed.

(1) Set the IP address, subnet mask, gateway and DNS server address of each server separately to adjust the network.

(2) Set DNS Server

1Create a standard primary area for forward search in DNS, implement the domain name

on the DNS server, click Start/Programs/Administrative Tools/DNS , open the DNS console.

In the console tree, right-click “Forward Search Area", click New Area/New Area Wizard/Next, and select the area type as “Standard Main Area”. If you do not create a DNS zone on the domain controller of the Active Directory, the <quo;A zone of Active Directory integration option button in the zone type is not available; click “Next”.

2Register multiple host resource records with the query name www. example.com.cn in the area example.com.cn.

Right-click the area example.com.cn in the DNS console tree and click New Host to bring up the “New Host” window. In the "Name" column, enter the host name www, enter the corresponding IP address 172.28.20.1 in the "IP address" column, click the "Add host", "ld"; OK & rdquo; button; repeat this process, the host The name is still www, and the IP address is 172.28.20.2, 172.28.20.3, and 172.28.20.4. Click “Complete”.

The four host records named www appear in the forward search area <;example.com.cn”, the pointers are 172.28.20.1, 172.28.20.2, 172.28.20.3, 172.28.20.4

3Enable round-robin reuse of multi-homed names

Click Start/Programs/Administrative Tools/DNS/DNS Server Name/Properties/Advanced, in “Server Options”, select “Enable Loop through the checkboxes and click “OK”. ---http://www.bianceng.cn

At this point, forward search queries are used for multihomed hosts with IP addresses of 172.20.20.1, 172.28.20.2, 172.28.20.3, and 172.28.20.4, respectively. (www.example.com.cn) configuration is completed, as shown in Figure 1.


DNS Server Configuration Diagram

When a client requests access to www.example.com.cn, the DNS server will periodically schedule the IP address in order of 172.28.20.1 The order of 172.28.20.2, 172.28.20.3 and 172.28.20.4 responds to the requirements of the first customer, and the next customer's request for the same information will be rotated after 172.28.20.2, 172.28.20.3, 172.28.20.4 and 172.20.20.1 In this sequential response, the rotation process will continue and DNS load balancing will be successfully implemented.

After setting the above steps, sometimes there will be doubts, why ping www.example.com.cn, return the same IP? The reason is very simple. This is because only one computer is used for testing. After the first ping, the computer will make a cache. Use multiple computers to ping, or ping each time on a computer, run ipconfig/flnshdns, you can test

The system has achieved its goal.

4 Two points to be aware of

(1) Local subnet priority

When the servers in the cluster are not on the same network segment, by default, when the client queries When resolving host names mapped to multiple IP addresses, the DNS service uses local subnet prioritization as a way to give a preferred IP address on the same network as

. This feature requires the client application to attempt to connect to the host using the most recent (and generally the fastest) IP address available for the connection.

The DNS service uses the local subnet priority as follows:

1 The DNS service determines if a prioritized query response for the local subnet is required.

If there are multiple address resource records that match the host name to be queried, the DNS service can reorder the records by their subnet location. If the host name of the query matches only one address resource

record, or if the client's IP network address matches the IP network address of any mapped address on the multiple resource record response list, then no prioritization is required.

2 For each resource record in the matching response list, the DNS service determines which records, if any, match the subnet location of the querying client.

The 3DNS service reorders the response list to rank the host address resource record that matches the local subnet of the requesting client in the first place in the response list.

After

④ prioritized order subnet response list is returned to the requesting client.

(2) Inadequacies

Although circular reuse DNS is a commonly used solution for load balancing on Web servers, this approach has its own drawbacks. Circular Reuse DNS uses DNS

to map incoming IP requests to a defined set of circular forms of the server. In the event of a server failure, the recurring DNS continues to send requests to the failed server, always

to remove the server from the DNS. This way many users must wait until the DNS connection times out before they can successfully access the target site.

5 Conclusion

Cluster load balancing is considered to be one of the top ten hot technologies. It is also a high-end application. The load balancing scheme in Internet/Intranet is widely used. Many large and medium-sized networks < Br>

It’s hard to get out of this technology. NAT load balancing, reverse proxy equalization, and DNS load balancing will be employed as needed. Load balancing with round-robin DNS is an economical and practical method that does not require the addition of expensive load balancing devices, and the server can be located anywhere on the Internet. The technology is currently used on some Web sites, including Yahoo.

Copyright © Windows knowledge All Rights Reserved