Sun Cluster 3.0 U1 Data Services Installation and Configuration Guide

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

This chapter describes the steps to install and configure the Sun Cluster HA for Domain Name Service (DNS) data service on your Sun Cluster servers.

This chapter contains the following procedures.

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


Note -

You can use SunPlex Manager to install and configure this data service. See the SunPlex Manager online help for details.


Installing and Configuring Sun Cluster HA for DNS

The following table 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"

View fault-monitor information 

"Sun Cluster HA for DNS Fault Monitor"

Installing DNS

This section describes the steps to install DNS and to enable DNS 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. See the in.named(1M) man page for information on how to set up DNS. The Sun Cluster configuration involves the following differences.

How to Install DNS

  1. Become superuser on a cluster member.

  2. Decide on the logical hostname that will provide the DNS service.

    This name should be a hostname that is set up when you install the Sun Cluster software. See the Sun Cluster 3.0 U1 Installation Guide for details on how to set up hostnames.

  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 the /usr/sbin directory before you begin the installation.

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


    Note -

    Create a dns directory and a named directory underneath the dns directory on a cluster file system, for example, /global/dns/named. See the Sun Cluster 3.0 U1 Installation Guide for information on how to set up cluster file systems.



    # 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 file to the /global/dns directory. Otherwise, create a named.conf file in this directory. See the in.named(1M) man page for information on the types of entries to place in named.conf or named.boot. 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 the named.conf file) under the /global/dns/named directory.

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

    On all the nodes, edit the /etc/resolv.conf file to contain the logical hostname. 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 hostname 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 hostname the first entry after the domain name. DNS attempts to use the addresses in the order that they are listed in the resolv.conf file to access the server.


    Note -

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


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

    In the following example, perform these steps.

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

    • Replace the logical-hostname variable with your actual logical hostname.


    127.0.0.1						localhost
    IPaddress						logical-hostname
    
  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.

    The following example shows how to complete this step.


    hosts:		 	cluster files dns
  10. Test DNS.

    Be sure to stop the in.named executable before you proceed. The following example shows how to test DNS.


    # 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 installed the Sun Cluster HA for DNS packages during 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

You can use the scinstall(1M) utility to install SUNWscdns, the Sun Cluster HA for DNS data-service package, on a cluster. Do not use the -s option to non-interactive scinstall to install all data-service packages.

If you installed the SUNWscdns data-service package during your initial Sun Cluster installation, proceed to "Registering and Configuring Sun Cluster HA for DNS". Otherwise, use the following procedure to install the SUNWscdns package.

How to Install Sun Cluster HA for DNS Packages

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

  1. Load the Agents CD into the CD-ROM drive.

  2. Run the scinstall utility with no options.

    This step starts the scinstall utility in interactive mode.

  3. Select the Add Support for New Data Service to This Cluster Node menu option.

    This option enables you to load software for any data services that exist on the CD.

  4. Exit the scinstall utility.

  5. Unload the CD from the drive.

Where to Go From Here

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

Registering and Configuring Sun Cluster HA for DNS

This procedure describes how to use the scrgadm(1M) command to register and configure the Sun Cluster HA for DNS data service.


Note -

Other options also enable you to register and configure the data service. See "Tools for Data-Service Resource Administration" for details about these options.


How to Register and Configure Sun Cluster HA for DNS

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


Note -

Perform this procedure on any cluster member.


  1. Become superuser on a cluster member.

  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 for logical hostnames and DNS resources to use.

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


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

    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 the -h option to specify the order of the node list. If all the nodes in the cluster are potential masters, you do not need to use the -h option.


  4. Verify that all logical hostnames that you will use have been added to your name-service database.

    You should have performed this verification during the Sun Cluster installation. See the planning chapter in the Sun Cluster 3.0 U1 Installation Guide for details.


    Note -

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


  5. Add logical-hostname resources to the resource group.


    # scrgadm -a -L -g resource-group \
    -l logical-hostname[,logical-hostname] [-j resource] \
    [-n netiflist]
    -L

    Specifies the logical-hostname resources.

    -l logical-hostname

    Specifies a comma-separated list of logical hostnames.

    -j resource

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

    -n netiflist

    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 netiflist. If you do not specify this option, the scrgadm command attempts to discover a net adapter on the subnet that the hostname list identifies for each node in nodelist.

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


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

    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 hostnames) that DNS will use. If you do not specify this property, the value defaults to all the logical hostnames 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, the value defaults to 53/udp.

    -x DNS_mode=config-file

    Specifies the configuration file to use, either conf(named.conf) or boot(named.boot). If you do not specify this property, the value 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. The Sun Cluster HA for DNS data service requires this extension property.

  7. Run the scswitch(1M) command to complete the following tasks.

    • Enable the resource and fault monitoring.

    • Move the resource group into a managed state.

    • Bring the resource group online.


    # scswitch -Z -g resource-group
    
    -Z

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

    -g resource-group

    Specifies the name of the resource group.

Example - Registering Failover Sun Cluster HA for DNS

The following example shows how to register the Sun Cluster HA for DNS data service 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: resource-group-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 resource-group-1
 
(Add the logical hostname resource to the resource group.)
# scrgadm -a -L -g resource-group-1 -l schost-1 
 
(Add DNS application resources to the resource group.)
# scrgadm -a -j dns-1 -g resource-group-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 resource-group-1

How to Configure SUNW.HAStorage Resource Type

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

See the SUNW.HAStorage(5) man page and "Relationship Between Resource Groups and Disk Device Groups" for background information. See "How to Set Up SUNW.HAStorage Resource Type for New Resources" for the procedure.

Verifying Data Service Installation and Configuration

To verify that you have correctly installed and configured the Sun Cluster HA for DNS data service, run the following command after you complete 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 that you have configured to service DNS requests-for example, schost-1-as shown in the previous registration example. The output should indicate that the logical host that you specified answered (served) the query.

Configuring Sun Cluster HA for DNS Extension Properties

The only required extension property for creating a DNS resource is the Confdir_list property. Typically, you use the command line scrgadm -x parameter=value to configure extension properties when you create the DNS resource. You can also use the procedures in Chapter 11, Administering Data-Service Resources to configure them later.

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

Table 6-2 describes the Sun Cluster HA for DNS extension properties. You can update some extension properties dynamically. You can update others, however, only when you create the resource. The Tunable column indicates when you can update the property.

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)

4

0 - 2,147,483,641

 

-1 indicates an infinite number of retry attempts.

Any time 

The number of times that the process monitor facility (PMF) restarts the fault monitor during the time window that the Monitor_retry_interval property specifies. This property refers to restarts of the fault monitor itself rather than to the resource. The system-defined properties Retry_interval and Retry_count control restarts of the resource.

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 that the fault monitor fails exceeds the value that is specified in the extension property Monitor_retry_count within this period, the PMF does not restart the fault monitor.

Probe_timeout (integer)

30 

0 - 2,147,483,641

Any time 

The time-out value (in seconds) that the fault monitor uses to probe a DNS instance. 

Sun Cluster HA for DNS Fault Monitor

The probe uses the nslookup command to query the health of DNS. Before the probe actually queries the DNS server, a check is made to confirm that network resources are configured in the same resource group as the DNS data service. If no network resources are configured, an error message is logged, and the probe exits with failure.

The probe executes the following steps.

  1. Run the nslookup command using the time-out value that the resource property Probe_timeout specifies.

    The result of this nslookup command can be either failure or success. If DNS successfully replied to the nslookup query, the probe returns to its infinite loop, waiting for the next probe time.

    If the nslookup fails, the probe considers this scenario a failure of the DNS data service and records the failure in its history. The DNS probe considers every failure a complete failure.

  2. Based on the success/failure history, a failure can cause a local restart or a data-service failover. "Health Checks of the Data Service" further describes this action.