Sun Cluster 3.0 Data Services Installation and Configuration Guide

Chapter 6 Installing and Configuring Sun Cluster HA for Domain Name Service (DNS)

This chapter describes the steps for installing and configuring Sun Cluster HA for Domain Name Service (DNS) on your Sun Cluster servers.

This chapter contains the following procedures:

You must configure Sun Cluster HA for DNS as a failover service. For general information on data services, resource groups, resources, and other related topics, see Chapter 1, Planning for Sun Cluster Data Services and the Sun Cluster 3.0 Concepts document.

Installing and Configuring Sun Cluster HA for DNS

Table 6-1 lists the sections that describe the installation and configuration tasks.

Table 6-1 Task Map: Installing and Configuring Sun Cluster HA for NFS

Task 

For Instructions, Go To ... 

Install DNS 

"Installing DNS"

Install Sun Cluster HA for DNS packages 

"Installing Sun Cluster HA for DNS Packages"

Configure and start Sun Cluster HA for DNS data service 

"Registering and Configuring Sun Cluster HA for DNS"

Configure resource extension properties 

"Configuring Sun Cluster HA for DNS Extension Properties"

Installing DNS

This section describes the steps for installing DNS and enabling it to run as the Sun Cluster HA for DNS data service.

The Sun Cluster HA for DNS data service uses the Internet Domain Name Server (in.named) software that is bundled with the Solaris 8 operating environment. For information on setting up DNS, see the in.named(1M) man page. The differences in a Sun Cluster configuration are as follows:

How to Install DNS

  1. Become superuser on a node in the cluster.

  2. Decide on the logical host name that will provide DNS service.

    This name should be a host name that is set up when you install the Sun Cluster software. For details on setting up host names, see the Sun Cluster 3.0 Installation Guide.

  3. Ensure that the DNS executable (in.named) is in the directory /usr/sbin.

    The DNS executable is bundled with the Solaris 8 operating environment and is located in /usr/sbin before you begin the installation.

  4. Create a directory structure on the cluster file system to hold the DNS configuration and database files.

    Create a dns directory and a named directory underneath it on a cluster file system, for example, /global/dns/named. For information on setting up cluster file systems, see the Sun Cluster 3.0 Installation Guide.


    # mkdir -p /global/dns/named
    
  5. Place the configuration file for DNS, named.conf or named.boot, under /global/dns.

    If DNS is already installed, you can copy the existing named.conf or named.boot to the /global/dns directory. Otherwise, create a named.conf file in this directory. For information on the types of entries to place in named.conf or named.boot, see the in.named(1M) man page. One of the two files, named.conf or named.boot, must exist. Both files can exist.

  6. Place all the DNS database files (listed in named.conf) under /global/dns/named.

  7. On all the clients of Sun Cluster HA for DNS, create an entry for the logical host name of the DNS service in the /etc/resolv.conf file.

    On all the nodes, edit /etc/resolv.conf to contain the logical host name. The following example shows the entries for a four-node configuration (phys-schost-1, phys-schost-2, phys-schost-3, and phys-schost-4) with the logical host name schost-1.eng.sun.com.


    domain eng.sun.com
     
    ; schost-1.eng.sun.com
    
    (Only entry to be added if the file is already present.)
     
    nameserver 192.29.72.90
     
    ; phys-schost-2.eng
    nameserver 129.146.1.151
     
    ; phys-schost-3.eng
    nameserver 129.146.1.152
     
    ; phys-schost-4.eng
    nameserver 129.144.134.19
     
    ; phys-schost-1.eng
    nameserver 129.144.1.57

    Make the logical host name the first entry after the domain name. DNS attempts to access the server by using the addresses in the order they are listed in resolv.conf.


    Note -

    If the /etc/resolv.conf is already present on the nodes, just add the first entry that shows the logical host name in the previous example. The order of the entries determines the order in which the DNS tries to access the server.


  8. On all the cluster nodes, edit /etc/inet/hosts to create an entry for the logical host name of the DNS service.

    In the following example:

    • Replace the IPaddress variable with your actual IP address, such as 129.146.87.53.

    • Replace the logicalhostname variable with your actual logical host name.


    127.0.0.1						localhost
    IPaddress						logicalhostname
    
  9. On all the cluster nodes, edit the /etc/nsswitch.conf file to add the string dns after cluster and files to the hosts entry.

    For example:


    hosts:		 	cluster files dns
  10. Test DNS.

    Be sure to stop in.named before proceeding. For example:


    # cd /global/dns
    # /usr/sbin/in.named -c /global/dns/named.conf
    # nslookup phys-schost-1
    # pkill -x /usr/sbin/in.named
    

Where to Go from Here

If you have already installed the Sun Cluster HA for DNS packages as part of your Sun Cluster installation, go to "Registering and Configuring Sun Cluster HA for DNS". Otherwise, go to "Installing Sun Cluster HA for DNS Packages".

Installing Sun Cluster HA for DNS Packages

The scinstall(1M) utility installs SUNWscdns, the Sun Cluster HA for DNS data service package, on a cluster. You can install specific data service packages from the Sun Cluster data service CD by using interactive scinstall, or you can install all data service packages on the CD by using the -s option to non-interactive scinstall. The preferred method is to use interactive scinstall, as described in the following procedure.

The data service packages might have been installed as part of your initial Sun Cluster installation. If not, use this procedure to install them now.

How to Install Sun Cluster HA for DNS Packages

You need the Sun Cluster data service CD to complete this procedure. Perform this procedure on all cluster nodes that can run Sun Cluster HA for DNS.

  1. Load the data service CD into the CD-ROM drive.

  2. Run scinstall with no options.

    This command starts scinstall in interactive mode.

  3. Select the menu option: "Add support for new data service to this cluster node."

    You can then load software for any data services that exist on the CD.

  4. Exit scinstall and unload the CD from the drive.

Where to Go from Here

See "Registering and Configuring Sun Cluster HA for DNS" to register Sun Cluster HA for DNS and configure the cluster for the data service.

Registering and Configuring Sun Cluster HA for DNS

To register and configure the Sun Cluster HA for DNS data service, use the Cluster Module of Sun Management Center or the following command-line procedure.

How to Register and Configure Sun Cluster HA for DNS

To perform this procedure, you need the following information about your configuration:

Perform this procedure on any cluster member.

  1. Become superuser on a node in the cluster.

  2. Register the resource type for the data service.


    # scrgadm -a -t SUNW.dns
    
    -a

    Adds the data service resource type.

    -t SUNW.dns

    Specifies the predefined resource type name for your data service.

  3. Create a resource group to be used by logical host names and DNS resources.

    You can optionally select the set of nodes on which the data service can run by using the -h option.


    # scrgadm -a -g resource-group-name [-h nodelist]
    -g resource-group-name

    Specifies the name of the resource group. This name can be your choice but must be unique for the resource groups within the cluster.

    -h nodelist

    Specifies an optional comma-separated list of physical node names or IDs that identify potential masters. The order here determines the order in which the nodes are considered as primary during failover.


    Note -

    Use -h to specify the order of the node list. If all the nodes in the cluster are potential masters, you need not use the -h option.


  4. Verify that all logical host names that you will be using have been added to your name service database.

    This verification should have been done as part of the Sun Cluster installation. For details, see the planning chapter in the Sun Cluster 3.0 Installation Guide.


    Note -

    To avoid any failures because of name service lookup, verify that all logical host names are present in the server's and client's /etc/hosts file. Configure name service mapping in /etc/nsswitch.conf on the servers to first check the local files before trying to access NIS or NIS+.


  5. Add logical host name resources to the resource group.


    # scrgadm -a -L -g resource-group-name \
    -l logical-hostname[,logical-hostname] [-j resource-name] \
    [-n network-interface-id-list]
    -L

    Specifies the logical host name resources.

    -l logical-hostname

    Specifies a comma-separated list of logical host names.

    -j resource-name

    Specifies an optional network resource name. If you do not specify this name, it defaults to the first name specified after the -l option.

    -n network-interface-id-list

    Specifies an optional comma-separated list that identifies the NAFO groups on each node. All the nodes in nodelist of the resource group must be represented in network-interface-list. If you do not specify this option, scrgadm attempts to discover a net adapter on the subnet identified by the hostname list for each node in nodelist.

  6. Add a DNS application resource to the resource group.


    # scrgadm -a -j [resource-name] -g resource-group-name \
    -t SUNW.dns -y Network_resources_used=network-resource, ...\
    -y Port_list=port-number/protocol -x DNS_mode=config-file-name \ 
    -x Confdir_list=config-directory
    
    -j resource-name

    Specifies the DNS application resource name.

    -t SUNW.dns

    Specifies the name of the resource type to which this resource belongs. This entry is required.

    -y Network_resources_used=network-resource, ...

    Specifies a comma-separated list of network resources (logical host names) to be used by DNS. If you do not specify this property, it defaults to all the logical host names contained in the resource group.

    -y Port_list=port-number/protocol

    Specifies a port number and the protocol to be used. If you do not specify this property, it defaults to 53/udp.

    -x DNS_mode=config-file-name

    Specifies the configuration file to use, either conf(named.conf) or boot(named.boot). If you do not specify this property, it defaults to conf.

    -x Confdir_list=config-directory

    Specifies the location of the DNS configuration directory paths, which must be on the cluster file system. This is a required extension property for Sun Cluster HA for DNS.

  7. Enable the resource and fault monitoring, move the resource group into a managed state, and bring it online.


    # scswitch -Z -g resource-group-name
    
    -Z

    Enables the resource and monitor, moves the resource group to the managed state, and brings it online.

    -g resource-group-name

    Specifies the name of the resource group.

Example-Registering Failover Sun Cluster HA for DNS

The following example shows how to register Sun Cluster HA for DNS on a two- node cluster. Note that at the end, the scswitch command starts the Sun Cluster HA for DNS data service.


Cluster Information
Node names: phys-schost-1, phys-schost-2
Logical hostname: schost-1
Resource group: lh-schost-1 (for all resources),  
Resources: schost-1 (logical hostname),	dns-1 (DNS application resource) 
 
(Register the DNS resource type)
# scrgadm -a -t SUNW.dns
 
(Add the resource group to contain all resources.)
# scrgadm -a -g lh-schost-1
 
(Add the logical host name resource to the resource group.)
# scrgadm -a -L -g lh-schost-1 -l schost-1 
 
(Add DNS application resources to the resource group.)
# scrgadm -a -j dns-1 -g lh-schost-1 -t SUNW.dns \
-y Network_resources_used=schost-1 -y Port_list=53/udp \
-x DNS_mode=conf -x Confdir_list=/global/dns
 
(Bring the failover resource group online.)
 
# scswitch -Z -g lh-schost-1

How to Configure SUNW.HAStorage Resource Type

The SUNW.HAStorage resource type synchronizes actions between HA storage and data service. Because Sun Cluster HA for DNS is not disk intensive and not scalable, setting up the SUNW.HAStorage resource type is optional.

For details on the background, see the SUNW.HAStorage(5) man page and "Relationship Between Resource Groups and Disk Device Groups". For the procedure, see "How to Set Up SUNW.HAStorage Resource Type for New Resources".

Verifying Data Service Installation and Configuration

To verify that Sun Cluster HA for DNS has been installed and configured correctly, run the following command after completing the procedure "How to Register and Configure Sun Cluster HA for DNS".


# nslookup logical-hostname logical-hostname

In this example, logical-hostname is the name of the network resource you have configured to service DNS requests, for example, schost-1, as shown in the previous registration example. The output should indicate that the query was answered (served) by the logical host you specified.

Configuring Sun Cluster HA for DNS Extension Properties

The only required extension property for creating a DNS resource is Confdir_list.

See Appendix A, Standard Properties for details on all Sun Cluster properties.

How to Configure Sun Cluster HA for DNS Extension Properties

Typically, you configure these properties by using the Cluster Module of Sun Management Center or the command line scrgadm -x parameter=value at the time you create the Sun Cluster HA for DNS server resource. You can also configure them later by using the procedures described in Chapter 9, Administering Data Service Resources.

Table 6-2 describes the Sun Cluster HA for DNS extension properties. Some extension properties can be updated dynamically and others only when the resource is created. The Tunable column indicates when the property can be updated.

Table 6-2 Sun Cluster HA for DNS Extension Properties

Name/Data Type 

Default 

Range 

Tunable 

Description 

Confdir_list (string array)

None 

None 

At creation 

A comma-separated list of path names, each of which points to the directory that contains the conf directory for a DNS instance

DNS_mode

conf

None 

At creation 

The DNS configuration file to use, either conf (named.conf) or boot (named.boot)

Monitor_retry_count (integer)

0 - 2,147,483,641 

 

-1 indicates an infinite number of retry attempts. 

Any time 

The number of times the fault monitor is to be restarted by the process monitor facility during the time window specified by the Monitor_retry_interval property. This property refers to restarts of the fault monitor itself rather than to the resource. Restarts of the resource are controlled by the system-defined properties Retry_interval and Retry_count.

Monitor_retry_interval (integer)

0 - 2,147,483,641 

 

-1 indicates an infinite retry interval. 

Any time 

The time (in minutes) over which failures of the fault monitor are counted. If the number of times the fault monitor fails exceeds the value specified in the extension property Monitor_retry_count within this period, the fault monitor is not restarted by the process monitor facility.

Probe_timeout (integer)

30 

0 - 2,147,483,641 

Any time 

The time-out value (in seconds) used by the fault monitor to probe a DNS instance