Chapter 6. Configuration Examples

This chapter provides an example of an IRIS FailSafe configuration that uses a three-node cluster and some variations of that configuration. In addition, this chapter provides instructions for exporting CXFS filesystems in a FailSafe configuration. It contains the following sections:

Example: Define a Three-Node Cluster

The following illustration shows a three-node FailSafe cluster. This configuration consists of a pool containing nodes N1, N2 , N3, and N4. Nodes N1, N2, and N3 make up the FailSafe cluster. The nodes in this cluster share disks, and are connected to an El-8 serial port multiplexer, which is also connected to the private control network.

Figure 6-1. FailSafe Configuration Example

Examples of FailSafe configurations that use this setup are provided in the following sections.

Example: Script to Define a Three-Node Cluster

This section provides an example cmgr script that defines a FailSafe three-node cluster as shown in Figure 6-1. For general information on cmgr scripts see “Using Script Files” in Chapter 4. For information on the template files that you can use to create your own configuration script, see “Template Scripts” in Chapter 4.

This cluster has two resource groups, RG1 and RG2, as shown in Table 6-1.

Table 6-1. Resources and Failover Policies for RG1 and RG2

 

Resources and Failover Policy

RG1

RG2

Resources

 

IP_address

192.26.50.1

192.26.50.2

 

filesystem

/ha1

/ha2

 

volume

ha1_vol

ha2_vol

 

NFS

/ha1/export

/ha2/export

Failover policy

 

Name

fp1

fp2

 

Script

ordered

round-robin

 

Attributes

Auto_Failback, Auto_Recovery

Controlled_Failback, InPlace_Recovery

 

Failover domain

N1, N2, N3

N2, N3

The cmgr script to define this configuration is as follows:

#!/usr/cluster/bin/cmgr -f
define node N1
        set hostname to N1
        set is_failsafe to true
        set sysctrl_type to msc
        set sysctrl_status to enabled
        set sysctrl_password to none
        set sysctrl_owner to N4
        set sysctrl_device to /dev/ttydn001
        set sysctrl_owner_type to tty
        add nic ef2-N1
                set heartbeat to true
                set ctrl_msgs to true
                set priority to 1
        done
        add nic ef0-N1
                set heartbeat to true
                set ctrl_msgs to true
                set priority to 2
        done
        add nic ef1-N1
                set heartbeat to true
                set ctrl_msgs to true
                set priority to 3
        done
done


define node N2
        set hostname to N2
        set is_failsafe to true
        set sysctrl_type to msc
        set sysctrl_status to enabled
        set sysctrl_password to none
        set sysctrl_owner to N4
        set sysctrl_device to /dev/ttydn002
        set sysctrl_owner_type to tty
        add nic ef2-N2
                set heartbeat to true
                set ctrl_msgs to true
                set priority to 1
        done
        add nic ef0-N2
                set heartbeat to true
                set ctrl_msgs to true
                set priority to 2
        done
        add nic ef1-N2
                set heartbeat to true
                set ctrl_msgs to true
                set priority to 3
        done
done

define node N3
        set hostname to N3
        set is_failsafe to true
        set sysctrl_type to msc
        set sysctrl_status to enabled
        set sysctrl_password to none
        set sysctrl_owner to N4
        set sysctrl_device to /dev/ttydn003
        set sysctrl_owner_type to tty
        add nic ef2-N3
                set heartbeat to true
                set ctrl_msgs to true
                set priority to 1
        done
        add nic ef0-N3
                set heartbeat to true
                set ctrl_msgs to true
                set priority to 2
        done
        add nic ef1-N3
                set heartbeat to true
                set ctrl_msgs to true
                set priority to 3
        done
done


define node N4
        set hostname to N4
        set is_failsafe to true
        add nic ef2-N4
                set heartbeat to true
                set ctrl_msgs to true
                set priority to 1
        done
        add nic ef0-N4
                set heartbeat to true
                set ctrl_msgs to true
                set priority to 2
        done
done
define cluster TEST
        set is_failsafe to true 
        set notify_cmd to /usr/bin/mail
        set notify_addr to failsafe_sysadm@company.com
        add node N1
        add node N2
        add node N3
done

define failover_policy fp1
        set attribute to Auto_Failback
        set attribute to Auto_Recovery
        set script to ordered
        set domain to N1 N2 N3
done


define failover_policy fp2
        set attribute to Controlled_Failback
        set attribute to InPlace_Recovery
        set script to round-robin
        set domain to N2 N3
done

define resource 192.26.50.1 of resource_type IP_address in cluster TEST
        set NetworkMask to 0xffffff00
        set interfaces to ef0,ef1
        set BroadcastAddress to 192.26.50.255
done

define resource ha1_vol of resource_type volume in cluster TEST
        set devname-owner to root
        set devname-group to sys
        set devname-mode to 666
done

define resource /ha1 of resource_type filesystem in cluster TEST
        set volume-name to ha1_vol
        set mount-options to rw,noauto
        set monitor-level to 2
done

modify resource /ha1 of resource_type filesystem in cluster TEST
        add dependency ha1_vol of type volume
done

define resource /ha1/export of resource_type NFS in cluster TEST
        set export-info to rw,wsync
        set filesystem to /ha1
done

modify resource /ha1/export of resource_type NFS in cluster TEST
        add dependency /ha1 of type filesystem
done
define resource_group RG1 in cluster TEST
        set failover_policy to fp1
        add resource 192.26.50.1 of resource_type IP_address
        add resource ha1_vol of resource_type volume
        add resource /ha1 of resource_type filesystem
        add resource /ha1/export of resource_type NFS
done


define resource 192.26.50.2 of resource_type IP_address in cluster TEST
        set NetworkMask to 0xffffff00
        set interfaces to ef0
        set BroadcastAddress to 192.26.50.255
done

define resource ha2_vol of resource_type volume in cluster TEST
        set devname-owner to root
        set devname-group to sys
        set devname-mode to 666
done

define resource /ha2 of resource_type filesystem in cluster TEST
        set volume-name to ha2_vol
        set mount-options to rw,noauto
        set monitor-level to 2
done

modify resource /ha2 of resource_type filesystem in cluster TEST
        add dependency ha2_vol of type volume
done

define resource /ha2/export of resource_type NFS in cluster TEST
        set export-info to rw,wsync
        set filesystem to /ha2
done

modify resource /ha2/export of resource_type NFS in cluster TEST
        add dependency /ha2 of type filesystem
done

define resource_group RG2 in cluster TEST
        set failover_policy to fp2
        add resource 192.26.50.2 of resource_type IP_address
        add resource ha2_vol of resource_type volume
        add resource /ha2 of resource_type filesystem
        add resource /ha2/export of resource_type NFS
done


quit

Example: Local Failover of HA IP Address

You can configure a FailSafe system to fail over a highly available (HA) IP address to a second interface within the same host. To do this, you specify multiple interfaces for resources of IP_address resource type. You can also specify different interfaces for supporting a heterogeneous cluster. For information on specifying HA IP address resources, see “IP_address Attributes” in Chapter 5.

The following example configures local failover of an HA IP address. It uses the configuration illustrated in Figure 6-1.

  1. Define an HA IP address resource with two interfaces:

    define resource 192.26.50.1 of resource_type IP_address in cluster TEST
              set NetworkMask to 0xffffff00
              set interfaces to ef0,ef1
              set BroadcastAddress to 192.26.50.255
    done

    HA IP address 192.26.50.1 will be locally failed over from interface ef0 to interface ef1 when there is an ef0 interface failure.

    In nodes N1, N2, and N3, either ef0 or ef1 should configure up automatically, when the node boots up. Both ef0 and ef1 are physically connected to the same subnet 192.26.50. Only one network interface connected to the same network should be configured up in a node.

  2. Modify the /etc/conf/netif.options file to configure the ef0 and ef1 interfaces:

    if1name-ef0
    if1addr=192.26.50.10
    
    if2name=ef1
    if2addr=192.26.50.11

  3. The etc/init.d/network script should configure the network interface ef1 down in all nodes N1, N2, and N3. Add the following line to the file:

    ifconfig ef1 down

Example: Modify a Cluster to Include a CXFS Filesystem

The following procedural example modifies the sample FailSafe configuration illustrated in Figure 6-1 so that it includes highly available NFS services on a CXFS filesystem. However, the CXFS resource type does not mount a CXFS filesystem. You should mount CXFS filesystem using the CXFS GUI as described in CXFS Version 2 Software Installation and Administration Guide. The CXFS resource type monitors the CXFS filesystem for mount failures.


Note: FailSafe assumes that CXFS filesystems are highly available because they do not require a FailSafe failover in order to be made available on another node in the cluster. Therefore, FailSafe does not directly start or stop CXFS filesystems nor does it stop, start, or monitor XVM volumes. XVM volumes should not be added to the FailSafe resource groups.

To modify the FailSafe configuration to include a CXFS filesystem, perform the following steps:

  1. Convert the cluster TEST for CXFS use. For information on converting FailSafe clusters to CXFS, see the CXFS Version 2 Software Installation and Administration Guide.

  2. Convert the nodes N1 and N2 for CXFS use. For information on converting FailSafe nodes to CXFS, see the CXFS Version 2 Software Installation and Administration Guide. Start CXFS services on the nodes.

  3. Create a new resource type NFS1. This is the same as resource type NFS but without a filesystem dependency. To create this resource type you can perform the following steps:

    1. Using cmgr, execute the following:

      cmgr> show resource_type NFS in cluster TEST

      The parameters of resource type NFS will be displayed.

    2. Define resource type NFS1 using the same configuration information that was displayed for resource type NFS, but do not copy the filesystem dependency.

  4. Define a new failover policy, FP3 , with the following attributes:

    • Failover domain: N1, N2

    • Script: ordered

    • Attribute: InPlace_Recovery

  5. Create a resource named /cxfs of resource type CXFS. /cxfs is the mount point of the CXFS filesystem. You can decide to relocate the metadata server of the CXFS filesystem /cxfs when the resource group moves to another node.

  6. Create a resource group named rg3 with failover policy fp3, resource ip3 of resource type IP_address, and resource /cxfs of resource type CXFS.

  7. Mount /cxfs on nodes N1 and N2. For information on defining and mounting a CXFS filesystem with an XVM volume, see CXFS Version 2 Software Installation and Administration Guide.

  8. Bring resource group RG3 online in cluster TEST.

Example: Export CXFS Filesystems

Perform the following steps to export CXFS filesystems in a FailSafe configuration:

  1. Ensure that the latest patches of the FailSafe/NFS 2.1 release are installed on all FailSafe nodes in the cluster.

  2. Perform all of steps mentioned in “Example: Modify a Cluster to Include a CXFS Filesystem”.

  3. If you are planning to export the /cxfs/share directory, create an NFS resource named /cxfs/share.

  4. Add the NFS resource to the resource group rg3 in addition to the HA IP address resource and the CXFS resource, using the following commands:

    define resource_group rg3 in cluster TEST
    set failover_policy to fp3
    add resource 99.92.99.99 of resource_type IP_address
    add resource /cxfs of resource_type CXFS
    add resource /cxfs/share of resource_type NFS
    done


Note: You cannot use this procedure to export the same CXFS filesystem or subdirectory from multiple nodes in the cluster.


Example: Create a Resource Group

Use the following procedure to create a resource group using cmgr:

  1. Determine the list of resources that belong to the resource group you are defining. The list of resources that belong to a resource group are the resources that move from one node to another as one unit.

    A resource group that provides NFS services would contain a resource of each of the following types:

    • IP_address

    • volume

    • filesystem

    • NFS

      All resource and resource-type dependencies must be satisfied. For example, the NFS resource type depends on the filesystem resource type, so a resource group containing a resource of NFS resource type must also contain a resource of filesystem resource type.

  2. Determine the failover policy to be used by the resource group.

  3. Use the template cluster_mgr script available in the /var/cluster/cmgr-templates/cmgr-create-resource_group file.

    This example shows a script that creates a resource group with the following characteristics:

    • The resource group is named nfs-group

    • The resource group is in cluster HA-cluster

    • The resource group uses the failover policy

    • The resource group contains IP_Address, volume, filesystem, and NFS resources

      The following script can be used to create this resource group:

      define resource_group nfs-group in cluster HA-cluster
              set failover_policy to n1_n2_ordered
              add resource 192.0.2.34 of resource_type IP_address
              add resource havol1 of resource_type volume
              add resource /hafs1 of resource_type filesystem
              add resource /hafs1 of resource_type NFS
      done

  4. Run this script using the -f option of the cmgr(1M) command.