How can DNS be used to load balance services?

The following uses a configuration example to describe how to configure and use DNS-based load balancing.

DNS-based load balancing is not supported in the V500R007C60 Kunpeng version.

Context

  • As shown in Table 7-1, a dual-controller storage system has two logical ports, which are created based on Ethernet ports on controller A and controller B.

    Table 7-1 Logical port information

    Logical Port Name

    IPv4 Address

    Home Port

    LogicPort_01

    192.168.20.10

    CTE0.A.IOM0.P0

    LogicPort_02

    192.168.20.20

    CTE0.B.IOM0.P0

  • An NFS share named /nfs_share and a CIFS share named cifs_share have been created on the storage system.
  • A client wants to access the storage system using the domain name testdns.abc123.com and uses the port bandwidth usage as the load balancing policy.

Storage System Configuration

  • The following describes how to configure the storage system on DeviceManager.
  • GUIs may vary with product versions and models. The actual GUIs prevail.

  1. Create a DNS zone.

    A DNS zone contains IP addresses of a group of logical ports. A host can use the name of a DNS zone to access shared services provided by a storage system. Services can be evenly distributed to logical ports.

    1. The operation path varies with user types:
      • System user: Click vStore, select the desired vStore, and click Details to go to the vStore view. Choose File Storage Service > DNS-based Load Balancing.
      • vStore user: In the vStore view, choose File Storage Service > DNS-based Load Balancing.
    2. In the DNS Zone area, Click Add.

      The Add DNS Zone dialog box is displayed.

    3. In Domain Name, type the domain name of the DNS zone you want to add and click OK. (In this example, enter abc123.com.)
    4. Click Save.

      The Execution Result page is displayed.

    5. Click Close.
  2. Configure logical ports to listen to DNS requests and associate with the DNS zone.
    1. Choose vStore > Details > Provisioning > Port > Logical Ports.
    2. Select LogicPort_01 and click Properties.

      The Logical Port Properties page is displayed.

    3. In Listen DNS Query Request, select Enable.
    4. In DNS Zone, click .

      The Select DNS Zone dialog box is displayed.

    5. Select DNS zone abc23.com and click OK.

      The Logical Port Properties page is displayed.

    6. Click OK.

      The security alert dialog box is displayed.

    7. Confirm the information in the dialog box and select I have read and understand the consequences associated with performing this operation.
    8. Click OK.
    9. Perform 2.a, 2.b, 2.d to 2.h to associate LogicPort_02 with the DNS zone.
  3. Configure a DNS-based load balancing policy and enable DNS-based load balancing.
    1. The operation path varies with user types:
      • System user: Click vStore, select the desired vStore, and click Details to go to the vStore view. Choose File Storage Service > DNS-based Load Balancing.
      • vStore user: In the vStore view, choose File Storage Service > DNS-based Load Balancing.
    2. For Load Balancing Policy, select Bandwidth usage from the drop-down list.
    3. For DNS-based Load Balancing, select Enable.
    4. Click Save.

      The Warning dialog box is displayed.

    5. Confirm the information in the dialog box and select I have read and understand the consequences associated with performing this operation.
    6. Click OK.

      The Execution Result page is displayed.

    7. Click Close.

Client Configuration

The following describes how to configure DNS server addresses and access shares on a Linux client and Windows client (Windows Server 2012).

  1. Configure DNS server addresses on the client.
    1. Linux client

      Add nameserver 192.168.20.10 to the /etc/resolv.conf file.

      You can run the nslookup <DNS zone name> command to check whether the domain name of the DNS zone can be resolved.

      If a Linux client is connected to built-in DNS load balancing servers on multiple storage systems, you are advised to optimize the /etc/resolv.conf file to prevent ping or mount timeout due to DNS zone name resolution failures between the storage systems. An example is provided as follows:

      Before:

      nameserver 10.0.0.1
      nameserver 10.0.0.2
      nameserver 10.0.0.3

      After:

      options timeout:1 attempts:1 rotate
      nameserver 10.0.0.1
      nameserver 10.0.0.2
      nameserver 10.0.0.3

      Parameters are described as follows:

      • timeout indicates the timeout time for querying a name server. It is expressed in seconds. Its default value is 5.
      • attempts indicates the number of attempts to query the entire name server list. The default value is 2.
      • rotate indicates that a name server is randomly selected as the preferred DNS server. If rotate is not used, the system selects the preferred DNS server from top to bottom by default. If any name server is recommended, do not use rotate and place the recommended name server in the first line of the name server list.

    2. Windows client

      In properties of the Ethernet port, set Preferred DNS server to 192.168.20.10.

      • If a client has multiple NICs and one NIC is configured with an IPv4 DNS server, the other NICs cannot be configured with IPv6 DNS servers.
      • If Windows clients cannot identify domain names that do not contain any period (.), you can configure the DNS zone name to contain a period (.).
      • If Windows clients automatically add an additional DNS domain name suffix, you can optimize the Windows host configuration.

        Choose Control Panel > Network and Internet > Network and Sharing Center. In the View your active networks area, click the connected network.

        In the displayed dialog box, click Properties. Then select Internet Protocol Version (TCP/IPv4) and click Properties.

        In the displayed dialog box, click Advanced. Then click the DNS tab page, and append the DNS suffix (.).

  2. Use the client to access shared file systems through the DNS zone domain name.

    • The following describes how to use a Linux client to access the NFS share /nfs_share and a Windows client to access the CIFS share cifs_share.
    • To access other types of shares, use the similar method. Replace the IP address of the logical port originally used to access shares with the DNS zone domain name (testdns.abc123.com).

    1. Use a Linux client to access an NFS share.

      Replace the IP address of the logical port originally used to access the NFS share with the DNS zone domain name (testdns.abc123.com).

      [root@localhost ~]# mount -t nfs -o vers=3,proto=tcp,rsize=1048576,wsize=1048576,hard,intr,timeo=600 testdns.abc123.com:/nfs_share /mnt
    2. Use a Windows client to access a CIFS share.

      In the Map Network Drive dialog box, set the mapping network folder in the format of \\DNS zone domain name \sharename.

      Complete user authentication as prompted. After authentication succeeds, the client can access the shared space.

How does DNS help in load balancing?

It facilitates faster access to a domain by providing several IP addresses for a single host or domain name, which routes traffic between two or more servers. DNS-based Load Balancing helps optimize client requests for a specific domain.

How can you configure load balancing to your mail servers using DNS?

The following are two possible ways used to load balance mail servers using DNS: Define multiple MX records with the same priority. Define multiple A records with the same name and different IP addresses.

What is DNS name in load balancer?

This DNS name includes the name of the AWS Region in which the load balancer is created. For example, if you create a load balancer named my-loadbalancer in the US West (Oregon) Region, your load balancer receives a DNS name such as my-loadbalancer-1234567890.us-west-2.elb.amazonaws.com .