Configuration Examples This chapter provides an example of a Linux FailSafe configuration that uses a three-node cluster, and some variations of that configuration. It includes the following sections: Linux FailSafe Example with Three-Node Cluster three-node cluster, exampleThe following illustration shows a three-node Linux FailSafe cluster. This configuration consists of a pool containing nodes N1, N2, N3, and N4. Nodes N1, N2, and N3 make up the Linux FailSafe cluster. The nodes in this cluster share disks, and are connected to a serial port multiplexer, which is also connected to the private control network. == REVIEWERS: NEW EXAMPLE TO COME ==
Configuration Example
cmgr Script This section provides an example cmgr script that defines a Linux FailSafe three-node cluster as shown in . For general information on CLI scripts, see . For information on the CLI template files that you can use to create your own configuration script, see . This cluster has two resource groups, RG1 and RG2. Resource group RG1 contains the following resources: IP_address 192.26.50.1 filesystem /ha1 volume ha1_vol NFS /ha1/export Resource group RG1 has a failover policy of FP1. FP1 has the following components: script ordered attributes Auto_Failback Auto_Recovery failover domain N1, N2, N3 Resource group RG2 contains the following resources: IP_address 192.26.50.2 filesystem /ha2 volume ha2_vol NFS /ha2/export Resource group RG2 has a failover policy of FP2. FP2 has the following components: script round-robin attributes Controlled_Failback Inplace_Recovery failover domain N2, N3 The cmgr script to define this configuration is as follows: #!/usr/cluster/bin/cluster_mgr -f define node N1 set hostname to N1 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 eth0-N1 set heartbeat to true set ctrl_msgs to true set priority to 2 done add nic eth1-N1 set heartbeat to true set ctrl_msgs to true set priority to 3 done done define node N2 set hostname to N2 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 eth0-N2 set heartbeat to true set ctrl_msgs to true set priority to 2 done add nic eth1-N2 set heartbeat to true set ctrl_msgs to true set priority to 3 done done define node N3 set hostname to N3 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 eth0-N3 set heartbeat to true set ctrl_msgs to true set priority to 2 done add nic eth1-N3 set heartbeat to true set ctrl_msgs to true set priority to 3 done done define node N4 set hostname to N4 add nic ef2-N4 set heartbeat to true set ctrl_msgs to true set priority to 1 done add nic eth0-N4 set heartbeat to true set ctrl_msgs to true set priority to 2 done done define cluster TEST 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 eth0,eth1 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 monitoring-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 eth0 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 monitoring-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 Local Failover of an IP Address IP addresslocal failover local failover, IP addressYou can configure a Linux FailSafe system to fail over an IP address to a second interface within the same host. To do this, 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 IP address resources, see . The following example configures local failover of an IP address. It uses the configuration illustrated in . Define an 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 eth0,eth1 set BroadcastAddress to 192.26.50.255 done IP address 192.26.50.1 will be locally failed over from interface eth0 to interface eth1 when there is an eth0 interface failure. In nodes N1, N2, and N3, either eth0 or eth1 should configure up automatically, when the node boots up. Both eth0 and eth1 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. Modify the /etc/conf/netif.options file to configure the eth0 and eth1 interfaces: if1name-eth0 if1addr=192.26.50.10 if2name=eth1 if2addr=192.26.50.11 The etc/init.d/network script should configure the network interface eth1 down in all nodes N1, N2, and N3. Add the following line to the file: ifconfig eth1 down