network load balance

25
Network Load Balance How To Perform Basic Network Load Balancing Procedures in Windows Server 2003 http://support.microsoft.com/kb/816111/en-us SUMMARY This step-by-step article describes how to perform basic Network Load Balancing procedures. When you use Network Load Balancing, you can spread incoming requests across many servers. When you do so, you can expand enterprise-wide services, such as Web servers, Terminal Services, and streaming media servers, to make sure that the services respond quickly, even under heavy loads. Network Load Balancing automatically detects when a server stops responding and quickly reassigns client traffic among the remaining servers. This safeguard helps you provide uninterrupted, continuous service for your critical business programs. How to Perform Network Load Balancing Procedures This section describes how to perform the following basic Network Load Balancing procedures: Stop Network Load Balancing Disable Network Load Balancing Enable multicast support

Upload: api-19972279

Post on 18-Nov-2014

441 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Network Load Balance

Network Load Balance

How To Perform Basic Network Load Balancing Procedures in Windows Server 2003http://support.microsoft.com/kb/816111/en-us

SUMMARYThis step-by-step article describes how to perform basic Network Load Balancing procedures. When

you use Network Load Balancing, you can spread incoming requests across many servers. When you do so, you can expand enterprise-wide services, such as Web servers, Terminal Services, and streaming media servers, to make sure that the services respond quickly, even under heavy loads.

Network Load Balancing automatically detects when a server stops responding and quickly reassigns client traffic among the remaining servers. This safeguard helps you provide uninterrupted, continuous service for your critical business programs.

How to Perform Network Load Balancing ProceduresThis section describes how to perform the following basic Network Load Balancing procedures:

• Stop Network Load Balancing

• Disable Network Load Balancing

• Enable multicast support

To Stop Network Load Balancing

• At a command prompt:

1. Click Start, click Run, type cmd in the Open box, and then click OK.

2. Type wlbs stop, and then press ENTER.

Cluster operations are immediately stopped on the local cluster host. If you want to stop cluster operations on all cluster hosts, type either of the following commands, where ip_address is the Internet Protocol (IP) address of the cluster and name is the name of the cluster:

• wlbs stop ip_address

Page 2: Network Load Balance

-or-

• wlbs stop name

From the Network Load Balancing Manager utility:

1.Start the Network Load Balancing Manager utility, and then connect to the cluster that you want to modify.

2. Under the cluster container, click the host that you want to stop.

3. On the Host menu, point to Control Host, and then click Stop.

To Disable Network Load Balancing

1.Start the Network Load Balancing Manager utility, and then connect to the cluster where you want to remove Network Load Balancing.

2. Right-click the cluster, and then click Delete Cluster.

3. Click Yes to remove Network Load Balancing from all the hosts that are members of the cluster.

If you cannot use Network Load Balancing Manager, you can remove Network Load Balancing through the network connections properties of each host. To do so:

1.Log on to the host computer as an administrator, and then double-click Network Connections in Control Panel.

2.Right-click the local area network connection where Network Load Balancing is installed, and then click Properties.

3. Click Internet Protocol (TCP/IP), and then click Properties.

4.

Remove the primary IP address for the cluster.

If the primary IP address for the cluster is in the Advanced TCP/IP Settings dialog box, click Advanced, and then remove the primary IP address for the cluster, and then remove any other cluster IP addresses that appear.

5. Click OK, click OK, and then click Close to return to the Network Connections dialog box.

6. Right-click the local area network connection that you previously edited, and then click Properties.

7. Click to clear the Network Load Balancing check box, and then click OK.

Page 3: Network Load Balance

To Enable Multicast Support

1.Start the Network Load Balancing Manager utility, and then connect to the cluster that you want to modify.

2.Right-click clustername (where clustername is the name of your cluster), and then click Cluster Properties.

3. Under Cluster operation mode, click Multicast, and then click OK.

4. On the message that states that the traffic mode will be changed from unicast to multicast, click Yes.

Troubleshooting

When you use the wlbs stop command or when you use the Network Load Balancing Manager to stop a cluster host, client computer connections that are already in progress may be interrupted. To avoid interrupting active connections, use the Drainstop cluster control command.

• To start the Network Load Balancing utility at a command prompt, type nlbmgr, and then press ENTER.

How To Configure Network Load Balancing Parameters in Windows Server 2003http://technet.microsoft.com/en-us/library/cc721929.aspx?wa=wsignin1.0

SUMMARYThis step-by-step article describes how to configure Network Load Balancing parameters in Windows

Server 2003.

You can use Network Load Balancing to spread incoming requests across as many as 32 servers. You can do so to expand enterprise-wide services, such as Web servers, Terminal Services, and streaming-media servers. Network Load Balancing also makes sure that your servers respond quickly, even under heavy loads. It does this by automatically detecting when a server stops working, and then quickly reassigning client traffic among the remaining servers. This safeguard can help you provide uninterrupted, continuous service for your critical business programs.

Back to the top

Configure Network Load Balancing ParametersTo configure Network Load Balancing parameters, you must configure the cluster parameters, host

parameters, and port rules.

Page 4: Network Load Balance

For additional information about how to set up TCP/IP for Network Load Balancing, click the article number below to view the article in the Microsoft Knowledge Base:

323431 (http://support.microsoft.com/kb/323431/EN-US/) How To Set Up TCP/IP for Network Load Balancing in Windows Server 2003

Configure Cluster Parameters

1.Click Start, click Control Panel, and then double-click Network Connections.

2. Right-click Local Area Connection, and then click Properties.

3.In the Local Area Connection Properties dialog box, click to select the Network Load Balancing check box, and then click Properties.

4.Click the Cluster Parameters tab, and then type values in the IP address, Subnet mask, and Full Internet name check boxes.

5.

Under Cluster operation mode, click Multicast to specify whether a multicast media access control address is used for cluster operations. If you select this option, Network Load Balancing converts the cluster network address into a multicast address when this is needed. It also makes sure that the cluster Internet Protocol (IP) addresses resolve to this multicast address as part of the Address Resolution Protocol (ARP). The network adapter to which the Network Load Balancing driver is bound retains its original media access control address. For more information, see the "Network Load Balancing clusters" Windows Server 2003 Help and Support Center topic.

6.Click to select the Allow remote control check box to turn on remote-control operations. Type the password in the Remote password and Confirm password boxes.

WARNING: The Network Load Balancing remote control option presents many security risks. Microsoft recommends that you do not turn on remote control and instead use Network Load Balancing Manager or other remote management tools such as Windows Management Instrumentation (WMI).

For additional information about the use of Remote Control in Network Load Balancing, see the "Network Load Balancing parameters: Network Load Balancing Clusters" Windows Server 2003 Help and Support Center topic.

Configure Host Parameters

1.Click Start, click Control Panel, and then double-click Network Connections.

Page 5: Network Load Balance

2. Right-click Local Area Connection, and then click Properties.

3.In the Local Area Connection Properties dialog box, click Network Load Balancing, and then click Properties.

4. Click the Host Parameters tab.

5. Type a value in the Priority (Unique host identifier) box.

6. Under Dedicated IP configuration, type values in the IP address and Subnet mask boxes.

7.Under Initial host state, specify the host state with regard to the Network Load Balancing cluster when Windows is started.

IMPORTANT: You may have a problem if you are working from a computer that has a single network adaptor that is bound to Network Load Balancing in Unicast mode. You cannot use Network Load Balancing Manager on this computer to configure and manage other hosts because a single network adapter in Unicast mode cannot have intra-host communication. However, you can communicate with computers that are outside the cluster.

To make sure that Network Load Balancing Manager is displaying the most recent host information, right-click the cluster, and then click Refresh. You must do so because the host properties that Network Load Balancing Manager displays are a copy of the host properties that were configured the last time Network Load Balancing Manager connected to that host. When you click Refresh, Network Load Balancing Manager reconnects to the cluster and displays updated information.

NOTE: You can also open the Network Load Balancing Properties dialog box through the Network Connections tool. However, Network Load Balancing Manager is the preferred method. If you use the Network Connections tool, you must make the same configuration changes on every cluster host. Using both Network Load Balancing Manager and the Network Connections tool together to change Network Load Balancing properties may create unpredictable results.

The parameters that are set in the Network Load Balancing Properties dialog box are recorded in the registry on each host. Changes to Network Load Balancing parameters are applied when you click OK in the Network Load Balancing Properties dialog box. Clicking OK stops Network Load Balancing (if it is running), reloads the parameters, and then restarts cluster operations.

Configure Port RulesBefore you continue, review the "Port Rules" section of the "Checklist: Enabling and configuring

Network Load Balancing" Windows Server 2003 Help and Support Center topic. Without a complete understanding of the topics that are addressed in this section, you cannot properly configure port rules.

Page 6: Network Load Balance

Configuring port rules includes the creation, editing, and removal of port rules.

To create port rules:

1. Click Start, click Control Panel, and then double-click Network Connections.

2. Right-click Local Area Connection, and then click Properties.

3.In the Local Connection Properties dialog box, click Network Load Balancing, and then click Properties.

4. Click the Port Rules tab, and then click ADD.

5.Type values for the Port range, Protocols, Filtering mode, Affinity, Load weight, and Handling priority boxes by using information from the installation check list.

6. Click OK.

To edit port rules:

1. Click Start, click Control Panel, and then double-click Network Connections.

2. Right-click Local Area Connection, and then click Properties.

3.In the Local Connection Properties dialog box, click Network Load Balancing, and then click Properties.

4. Click the Port Rules tab.

5.In the list of rules, double-click the rule to display the rule's parameters in the Configuration area above the list of rules.

6. Modify the Port range, Protocols, and Filtering mode parameters as necessary.

7. Click OK.

To remove port rules:

1. Click Start, click Control Panel, and then double-click Network Connections.

2. Right-click Local Area Connection, and then click Properties.

3.In the Local Area Connection Properties dialog box, click Network Load Balancing, and then click Properties.

4. Click the Port Rules tab, click the rule that you want to remove, and then click Remove.

Page 7: Network Load Balance

IMPORTANT: The number and type of rules must be exactly the same for each host in the cluster. You can make sure of this by using Network Load Balancing Manager to configure port rules (see the second note below). If you are using Network Load Balancing Manager, when you add additional hosts, they automatically inherit the cluster port rules from the initial host.

If a host tries to join the cluster with a different number of rules, or with different rules from the other hosts, it is not accepted as part of the cluster. The rest of the cluster then continues to handle the traffic as before. At the same time, a message is entered into the Windows event log. When this occurs, see the Event log to determine which host is in conflict with the other cluster hosts, resolve the conflict, and then restart Network Load Balancing on that host.

To allow Network Load Balancing to properly handle IP fragments, avoid using None when you select UDP or Both for your protocol setting.

NOTE: When you are using Network Load Balancing Manager, you must be a member of the Administrators group on the host that you are configuring, or you must have been delegated the appropriate authority. As a security best practice, consider using "Run as" to perform this procedure. If you are configuring a cluster or host by running Network Load Balancing Manager from a computer that is not part of the cluster, you do not have to be a member of the Administrators group on that computer.

You can also open the Network Load Balancing Properties dialog box through the Network Connections tool. However, Network Load Balancing Manager is the preferred method. If you use the Network Connections tool, you must make the same configuration changes on every cluster host. Using both Network Load Balancing Manager and the Network Connections tool together to change Network Load Balancing properties may lead to unpredictable results.

If all your hosts are running a product in Windows Server 2003, you can specify port rules to apply to only specific IP addresses. This is useful when you create virtual clusters. If you are not running Windows Server 2003, you must apply the port rules to all IP addresses. For more information about virtual clusters, see "Understanding Virtual Clusters".

The list of all currently installed port rules is sorted by port range.

The parameters that are set in the Network Load Balancing Properties dialog box are recorded in the registry on each host.

Changes to Network Load Balancing parameters are applied when you click OK in the Network Load Balancing Properties dialog box. Clicking OK stops Network Load Balancing (if it is running), reloads the parameters, and then restarts cluster operations.

If you are working from a computer that has a single network adaptor that is bound to Network Load

Page 8: Network Load Balance

Balancing in Unicast mode, you cannot use Network Load Balancing Manager on this computer to configure and manage other hosts because a single network adapter in Unicast mode cannot have intra-host communication. However, you can communicate with computers that are outside the cluster.

To make sure that Network Load Balancing Manager is displaying the most recent host information, right-click the cluster, and then click Refresh. You must do so because the host properties that Network Load Balancing Manager displays are a copy of the host properties that were configured the last time Network Load Balancing Manager connected to that host. When you click Refresh, Network Load Balancing Manager reconnects to the cluster and displays updated information.

Back to the top

Enable Multicast Support

1.To start Network Load Balancing Manager, type nlbmgr at a command prompt, and then press ENTER.

2. If Network Load Balancing Manager does not already list the cluster, connect to the cluster.

3. Right-click the cluster, and then click Cluster Properties.

4.On the Cluster Parameters tab, in Cluster operation mode, click Multicast. If appropriate, you can also enable Internet Group Management Protocol (IGMP) support by clicking to select the IGMP multicast check box.

IMPORTANT: If you are working from a computer that has a single network adaptor that is bound to Network Load Balancing in Unicast mode, you cannot use Network Load Balancing Manager on this computer to configure and manage other hosts because a single network adapter in Unicast mode cannot have intra-host communication. However, you can communicate with computers that are outside the cluster.

NOTE: When you are using Network Load Balancing Manager, you must be a member of the Administrators group on the host that you are configuring, or you must have been delegated the appropriate authority. As a security best practice, consider using "Run as" to perform this procedure. If you are configuring a cluster or host by running Network Load Balancing Manager from a computer that is not part of the cluster, you do not have to be a member of the Administrators group on that computer.

You can also open the Network Load Balancing Properties dialog box through the Network Connections tool. However, Network Load Balancing Manager is the preferred method. If you use the Network Connections tool, you must make the same configuration changes on every cluster host. Using both Network Load Balancing Manager and the Network Connections tool together to change Network Load Balancing properties may lead to unpredictable results.

Page 9: Network Load Balance

You can only enable IGMP support when your cluster is configured for multicast mode. If you enable IGMP support, the permitted multicast IP address is restricted to the standard class D range. This is 224.0.0.0 to 239.255.255.255.

Back to the top

Enable Internet Group Management Protocol (IGMP) Support

1.To start Network Load Balancing Manager, type nlbmgr at a command prompt, and then press ENTER.

2. If Network Load Balancing Manager does not already list the cluster, connect to the cluster.

3. Right-click the cluster, and then click Cluster Properties.

4.On the Cluster Parameters tab, click to select the IGMP multicast check box to enable IGMP support on all the hosts in the cluster.

IMPORTANT: If you are working from a computer that has a single network adaptor that is bound to Network Load Balancing in Unicast mode, you cannot use Network Load Balancing Manager on this computer to configure and manage other hosts because a single network adapter in Unicast mode cannot have intra-host communication. However, you can communicate with computers that are outside the cluster.

NOTE: When you are using Network Load Balancing Manager, you must be a member of the Administrators group on the host that you are configuring, or you must have been delegated the appropriate authority. As a security best practice, consider using "Run as" to perform this procedure. If you are configuring a cluster or host by running Network Load Balancing Manager from a computer that is not part of the cluster, you do not have to be a member of the Administrators group on that computer.

You can also open the Network Load Balancing Properties dialog box through the Network Connections tool. However, Network Load Balancing Manager is the preferred method. If you use the Network Connections tool, you must make the same configuration changes on every cluster host. Using both Network Load Balancing Manager and the Network Connections tool together to change Network Load Balancing properties may lead to unpredictable results.

You can only enable IGMP support when your cluster is configured for multicast mode. If you enable IGMP support, the permitted multicast IP address is restricted to the standard class D range. This is 224.0.0.0 to 239.255.255.255.

Back to the top

Page 10: Network Load Balance

Manage Existing Clusters from Network Load Balancing Manager by Using a Host List

From the Windows interface:

1.To start Network Load Balancing Manager, type nlbmgr at a command prompt, and then press ENTER.

2. On the File menu, click Load Host List.

3.

Locate your host list text file, click it, and then click Open.

IMPORTANT: If you are working from a computer that has a single network adaptor that is bound to Network Load Balancing in Unicast mode, you cannot use Network Load Balancing Manager on this computer to configure and manage other hosts because a single network adapter in Unicast mode cannot have intra-host communication. However, you can communicate with computers that are outside the cluster.

For security reasons, make sure that only users in the local Administrators group have access to the host list file.

NOTE: When you are using Network Load Balancing Manager, you must be a member of the Administrators group on the host that you are configuring, or you must have been delegated the appropriate authority. As a security best practice, consider using "Run as" to perform this procedure. If you are configuring a cluster or host by running Network Load Balancing Manager from a computer that is not part of the cluster, you do not have to be a member of the Administrators group on that computer.

The host list text file is a text file that you create by using Notepad or any other similar tool. The file must list the name of each host. Each host name must be separated by a line break. You can include comments in the host list by preceding the comment with a semicolon (;).

You can use this procedure to connect to multiple hosts and all Network Load Balancing clusters on those hosts. The clusters and hosts are then displayed in Network Load Balancing Manager. This is particularly useful when a host's Network Load Balancing network adapter is having connectivity problems, but another network adapter is available on that host. You can also use this procedure to detect and diagnose problems such as cluster hosts that are converging separately.

• At a command prompt:

1. Click Start, point to All Programs, point to Accessories, and then click Command Prompt.

2. At the command prompt, type nlbmgr /hostlist host-list, and then press ENTER, where host-list is the fully qualified path to a text file that you create using Notepad or any other similar tool. The file

Page 11: Network Load Balance

must list the name of each host. Each host name must be separated by a line break.

IMPORTANT: For security reasons, make sure that only users in the local Administrators group have access to the host list file.

NOTE: To run Nlb.exe from a remote computer, you must enable remote control on the host that is running Network Load Balancing. The Network Load Balancing remote control option presents many security risks. Only use remote control on a secure computer inside your firewall. Because of the many security risks remote control presents, Microsoft recommends that you do not enable the remote control feature. Instead, use other remote management tools such as Network Load Balancing Manager or Windows Management Instrumentation (WMI).

When you are using Nlb.exe, you must be a member of the Administrators group on the host that you are configuring, or you must have been delegated the appropriate authority. As a security best practice, consider using "Run as" to perform this procedure. If you are configuring a cluster or host by running Nlb.exe from a computer that is not part of the cluster, you do not have to be a member of the Administrators group on that computer.

To view the complete syntax for this command, type nlbmgr /help at a command prompt, and then press ENTER.

Make sure that only users in the local Administrators group have access to the host list file.

You can include comments in the host list by preceding the comment with a semicolon (;).

You can use this procedure to connect to multiple hosts and all Network Load Balancing clusters on those hosts. The clusters and hosts are then displayed in Network Load Balancing Manager. This is particularly useful when a host's Network Load Balancing network adapter is having connectivity problems, but another network adapter is available on that host. You can also use this procedure to detect and diagnose problems such as cluster hosts that are converging separately.

Back to the top

TroubleshootingThe number and type of rules must be exactly the same for each host in the cluster. If a host tries to

join the cluster with a different number of rules from the other hosts, it is not accepted as part of the cluster, and the rest of the cluster continues to handle the traffic as before. At the same time, a message is logged in the Windows Event log. If this occurs, view the Event log to determine which host is in conflict with the other cluster hosts, resolve the conflict, and then restart Network Load Balancing on that host.

You must also add the cluster IP address or addresses to the TCP/IP settings of the local area connection:

Page 12: Network Load Balance

1. Click Start, click Control Panel, and then double-click Network Connections.

2. Right-click Local Area Connection, and then click Properties.

3. In the Local Area Connection Properties dialog box, click Internet Protocol, and then click Properties.

4. Click Advanced.

5. Click ADD.

6. Add the cluster IP and subnet mask addresses.

7. Confirm your changes.

How To Set Up TCP/IP for Network Load Balancing in Windows Server 2003http://support.microsoft.com/kb/323431/en-us

SUMMARYThis article describes how to set up Transmission Control Protocol/Internet Protocol (TCP/IP) for

Network Load Balancing, which is typically the last step of a Network Load Balancing installation.

Page 13: Network Load Balance

With Network Load Balancing, you can spread incoming requests across as many as 32 servers. With this feature, you can expand enterprise-wide services such as Web servers, Terminal Services, and streaming media servers, and you can make sure that they can respond quickly, even under heavy loads.

Network Load Balancing automatically detects the failure of a server, and then quickly reassigns client computer traffic among the remaining servers. This safeguard can help you to provide uninterrupted, continuous service for your critical business programs.

IMPORTANT: You can configure many network load balancing options in the Network Load Balancing Manager or in the Network Load Balancing Properties dialog box. (To view the Network Load Balancing Properties dialog box, start the Network Connections tool). Microsoft recommends that you use the Network Load Balancing Manager.

WARNING: Do not use both Network Load Balancing Manager and Network Connections to configure Network Load Balancing properties; this may produce unpredictable results. The Network Load Balancing Manager is the recommended tool for modifying network load balancing settings.

NOTE: If the IP addresses of the server are configured before Network Load Balancing configuration is complete, and the Network Load Balancing Manager is used to configure the cluster, you do not have to do step 6 of the "Set Up TCP/IP for Network Load Balancing on Multiple Network Adapters" section of this article.

Set Up TCP/IP for Network Load BalancingYou must use different procedures for single or multiple adapters.

NOTE: When you try to configure Network Load Balancing manually and you add the Cluster IP and subnet mask, you receive the following message:

When you enter a new IP address or subnet mask for this cluster or host, you must also enter the new address in the Internet Protocol (TCP/IP) component.

To enter the address, follow the steps listed in setting up TCP/IP for Network Load Balancing in Windows Help.

Set Up TCP/IP for Network Load Balancing on a Single Network Adapter

1.Click Start, point to Control Panel, point to Network Connections, and then click the Local Area Connection on which Network Load Balancing is installed.

2. Click Properties.

3.In the Local Area Connection Properties dialog box, click Internet Protocol (TCP/IP), and then click Properties.

Page 14: Network Load Balance

4.In the IP address box, type the address that you typed as the "Dedicated IP address" in the Network Load Balancing Properties dialog box under Host parameters. If the correct address is already present, do not change the address.

5.In the Subnet Mask box, type the subnet mask and the default gateway information for your TCP/IP network. Click Advanced, and then click Add.

6.

Type the cluster IP address in the space for IP address, and then type the appropriate subnet mask and, if you have to, type the default gateway. This IP address corresponds to the "Cluster IP address" (formerly known as "Primary IP address") of the cluster that you typed in the Network Load Balancing Properties dialog box under Cluster parameters.

7.If you have to configure additional virtual IP addresses for your cluster (for example, if you are running a multihomed Web server), you can do so at this location in the Advanced TCP/IP Settings dialog box.

To Set Up TCP/IP for Network Load Balancing on Multiple Network Adapters

1.Click Start, point to Control Panel, point to Network Connections, and then click the Local Area Connection on which Network Load Balancing is installed.

2. Click Properties.

3.In the Local Area Connection Properties dialog box, click Internet Protocol (TCP/IP), and then click Properties.

4.

In IP address, type the address that you typed as the "Cluster IP address" in the Network Load Balancing Properties dialog box under Cluster parameters. If the correct address is already present, do not change the address.

NOTE: You can also type the dedicated IP address (that corresponds to the "Dedicated IP address" that you typed in the Network Load Balancing Properties dialog box under Host parameters) in this space, and then wait to type the primary IP address of the cluster in the Advanced TCP/IP Settings dialog box.

5. In Subnet Mask, type the subnet mask and the default gateway information for your TCP/IP network.

6.If you have to configure additional virtual IP addresses for your cluster (for example, if you are running a multihomed Web server), click Advanced, and then click Add. You can specify additional virtual IP addresses for this network adapter and provide other information.

Troubleshooting

•TCP/IP must be the only network protocol present on the cluster adapter. You must not add any other protocols (for example, Internetwork Packet Exchange [IPX]) to this adapter.

Page 15: Network Load Balance

•You must type the dedicated IP address first, in the Internet Protocol (TCP/IP) Properties dialog box (not in the Advanced TCP/IP Settings dialog box), so that all outbound connections that are made on behalf of this host (for example, Telnet or File Transfer Protocol [FTP]) are initiated with this address.

HOWTO - Configure Load Balancing

http://www.zytrax.com/books/dns/ch9/rr.html

This HOWTO assumes you want the DNS server to respond with different addresses in order to provide a simple load balancing solution. You have a choice of solutions based on what you want to do:

Using the MX record you can balance mail in two ways. You can also configure DNS to provide a kinda mail service fail-over.

Define multiple MX records with the same priority e.g.

; zone file fragment

Page 16: Network Load Balance

IN MX 10 mail.example.com.

IN MX 10 mail1.example.com.

IN MX 10 mail2.example.com.

....

mail IN A 192.168.0.4

mail1 IN A 192.168.0.5

mail2 IN A 192.168.0.6

The name server will deliver the MX records in the order defined by the rrset-order and the receiving SMTP software will select one based on its algorithm. In some cases the SMTP alogithm may work against the definition of the rrset-order statement. Current versions of sendmail (8.13.x), Exim (4.44) and Postfix (2.1 or 2.2) all have definitive references to indicate they randomly select equal preference servers (Postfix allows control of the behaviour with the smtp_randomize_addresses parameter) and consequentially may use an address which the rrset-order has carefully tried to change! qmail, courier-mta and Microsoft (Exchange and IIS SMTP) documentation do not appear to have definitive references to indicate how they handle this case.

The alternate approach is to define multiple A records with the same name and different IP addresses.

; zone file fragment

IN MX 10 mail.example.com.

....

mail IN A 192.168.0.4

IN A 192.168.0.5

IN A 192.168.0.6

In this case the load-balancing effect is under the control of BIND and the rrset-order record. In order to avoid problems if the receiving mail system does reverse look-up as a spam check then the PTR records for 192.168.0.4, 192.168.0.5, 192.168.0.6 above must all define to mail.example.com.

In all the above cases each mail server must be capable of handling and synchronising the load for all the mail boxes served by the domain, using some appropriate back-end to do this or by defining all but one server to be a relay or forwarder.

Page 17: Network Load Balance

Balancing Other Services

Assuming you want to load share your ftp or web services then you simply define multiple A records with the same name and different IPs as in the example below.

; zone file fragment

ftp IN A 192.168.0.4

ftp IN A 192.168.0.5

ftp IN A 192.168.0.6

www IN A 192.168.0.7

www IN A 192.168.0.8

; or use this format which gives exactly the same result

ftp IN A 192.168.0.4

IN A 192.168.0.5

IN A 192.168.0.6

www IN A 192.168.0.7

IN A 192.168.0.8

The DNS will deliver all the IP addresses defined, the first IP address in the list will be in a default round robin (controlled by the rrset 'named.conf' directive). The FTP and WEB servers must all be exact replicas of each other in this scenario.

Balancing Services

The SRV record provides the kind of fine control that you are probably looking for to balance load with a fine level of granularity as well as provide some level of fail-over. It provides both priority and weight fields for the purpose. The SRV record description contains an example illustrating this kind of flexibility.

Controlling the order of RRs

You can control the order of RR that BIND supplies in response to queries by use of a rrset-order option which works for any set of equal records. The default behaviour is defined to be random-cyclic - a

Page 18: Network Load Balance

random selection of the initial order thereafter cyclic (round-robin). Experimentation with BIND 9.3.0 showed that the default is cyclic.

Effectiveness of DNS Load Balancing

Assuming the interest in controlling the order is to load balance across multiple servers supporting a single service - the real question is how effective can the DNS system be in providing this balancing?

The effects of caching will distort the effectiveness of any IP address allocation algorithm unless a 0 TTL is used which has the effect of significantly increasing the load on the DNS (and is not always implemented consistently). In this case the cure may be worse than the disease Good news we have good load balancing on our web servers. Bad news we need 17 more DNS servers!. Intuitively, and without running any experiments to verify, we would suggest that given a normal TTL (12 hours or more) and ANY IP allocation algorithm other than a single static list, loads should be reasonably balanced (measured by request arrivals at destination IPs) given the following assumptions:

traffic is balanced over a number of DNS caches i.e. traffic originates from a number of ISPs or customer locations. Specifically there are no PATHOLOGICAL patterns where 90% (or some large'ish number) of the load originates from a particular cache/service).

the volume of traffic is reasonably high - since PATHOLOGICAL patterns are more likely in small traffic volumes.What DNS load balancing cannot do is to account for service loading e.g. certain transactions may generate very high CPU or resource loads. For this type of control only a local load balancer - one which measures response times - will be effective.Finally on this topic if you still consider that a DNS solution will do the trick if only you could control the order of IP address generation you can use the BIND 9 SDB API to achieve the result (or one of the available libraries).Problems, comments, suggestions, corrections (including broken links) or something to add? Please take the time from a busy life to 'mail us' (at top of screen), the webmaster (below) or info-support at zytrax. You will have a warm inner glow for the rest of the day.