The following Cluster Manager CLI script provides an example which shows how to configure a cluster in the cluster database. The script illustrates the CLI commands that you execute when you define a cluster. You will use the parameters of your own system when you configure your cluster. After you create a CLI script, you can set the execute permissions and execute the script directly.
For general information on CLI scripts, see Section 4.3.4. For information on the CLI template files that you can use to create your own configuration script, see Section 4.3.5.
#!/usr/lib/failsafe/bin/cluster_mgr -f ################################################################# # # # Sample cmgr script to create a 2-node cluster in the cluster # # database (cdb). # # This script is created using cmgr template files under # # /usr/lib/failsafe/cmgr-scripts directory. # # The cluster has 2 resource groups: # # 1. nfs-group - Has 2 NFS, 2 filesystem, 2 volume, 1 statd and # # 1 IP_address resources. # # 2. web-group - Has 1 Netscape_web and 1 IP_address resources. # # # # NOTE: After running this script to define the cluster in the # # cdb, the user has to enable the two resource groups using the # # cmgr admin online resource_group command. # # # ################################################################# # # Create the first node. # Information to create a node is obtained from template script: # /usr/lib/failsafe/cmgr-templates/cmgr-create-node # # # # logical name of the node. It is recommended that logical name of the # node be output of hostname(1) command. # define node sleepy # # Hostname of the node. This is optional. If this field is not # specified,logical name of the node is assumed to be hostname. # This value has to be # the output of hostname(1) command. # set hostname to sleepy # # Node identifier. Node identifier is a 16 bit integer that uniquely # identifies the node. This field is optional. If value is # not provided,cluster software generates node identifier. # Example value: 1 set nodeid to 101 # # Description of the system controller of this node. # System controller can be “chalL” or “msc” or “mmsc”. If the node is a # Challenge DM/L/XL, then system controller type is “chalL”. If the # node is Origin 200 or deskside Origin 2000, then the system # controller type is “msc”. If the node is rackmount Origin 2000, the # system controller type is “mmsc”. # Possible values: msc, mmsc, chalL # set sysctrl_type to msc # # You can enable or disable system controller definition. Users are # expected to enable system controller definition after verify the # serial reset cables connected to this node. # Possible values: enabled, disabled # set sysctrl_status to enabled # # The system controller password for doing privileged system controller # commands. # This field is optional. # set sysctrl_password to none # # System controller owner. The node name of the machine that is # connected using serial cables to system controller of this node. # System controller node also has to be defined in the CDB. # set sysctrl_owner to grumpy # # System controller device. The absolute device path name of the tty # to which the serial cable is connected in this node. # Example value: /dev/ttyd2 # set sysctrl_device to /dev/ttyd2 # # Currently, the system controller owner can be connected to the system # controller on this node using “tty” device. # Possible value: tty # set sysctrl_owner_type to tty # # List of control networks. There can be multiple control networks # specified for a node. HA cluster software uses these control # networks for communication between nodes. At least two control # networks should be specified for heartbeat messages and one # control network for failsafe control messages. # For each control network for the node, please add one more # control network section. # # Name of control network IP address. This IP address must # be configured on the network interface in /etc/rc.config # file in the node. # It is recommended that the IP address in internet dot notation # is provided. # Example value: 192.26.50.3 # add nic 192.26.50.14 # # Flag to indicate if the control network can be used for sending # heartbeat messages. # Possible values: true, false # set heartbeat to true # # Flag to indicate if the control network can be used for sending # failsafe control messages. # Possible values: true, false # set ctrl_msgs to true # # Priority of the control network. Higher the priority value, lower the # priority of the control network. # Example value: 1 # set priority to 1 # # Control network information complete # done # # Add more control networks information here. # # Name of control network IP address. This IP address must be # configured on the network interface in /etc/rc.config # file in the node. # It is recommended that the IP address in internet dot # notation is provided. # Example value: 192.26.50.3 # add nic 150.166.41.60 # # Flag to indicate if the control network can be used for sending # heartbeat messages. # Possible values: true, false # set heartbeat to true # # Flag to indicate if the control network can be used for sending # failsafe control messages. # Possible values: true, false # set ctrl_msgs to false # # Priority of the control network. Higher the priority value, lower the # priority of the control network. # Example value: 1 # set priority to 2 # # Control network information complete # done # # Node definition complete # done # # Create the second node. # Information to create a node is obtained from template script: # /usr/lib/failsafe/cmgr-templates/cmgr-create-node # # # # logical name of the node. It is recommended that logical name of # the node be output of hostname(1) command. # define node grumpy # # Hostname of the node. This is optional. If this field is not # specified,logical name of the node is assumed to be hostname. # This value has to be # the output of hostname(1) command. # set hostname to grumpy # # Node identifier. Node identifier is a 16 bit integer that uniquely # identifies the node. This field is optional. If value is # not provided,cluster software generates node identifier. # Example value: 1 set nodeid to 102 # # Description of the system controller of this node. # System controller can be “chalL” or “msc” or “mmsc”. If the node is a # Challenge DM/L/XL, then system controller type is “chalL”. If the # node is Origin 200 or deskside Origin 2000, then the system # controller type is “msc”. If the node is rackmount Origin 2000, # the system controller type is “mmsc”. # Possible values: msc, mmsc, chalL # set sysctrl_type to msc # # You can enable or disable system controller definition. Users are # expected to enable system controller definition after verify the # serial reset cables connected to this node. # Possible values: enabled, disabled # set sysctrl_status to enabled # # The system controller password for doing privileged system controller # commands. # This field is optional. # set sysctrl_password to none # # System controller owner. The node name of the machine that is # connected using serial cables to system controller of this node. # System controller node also has to be defined in the CDB. # set sysctrl_owner to sleepy # # System controller device. The absolute device path name of the tty # to which the serial cable is connected in this node. # Example value: /dev/ttyd2 # set sysctrl_device to /dev/ttyd2 # # Currently, the system controller owner can be connected to the system # controller on this node using “tty” device. # Possible value: tty # set sysctrl_owner_type to tty # # List of control networks. There can be multiple control networks # specified for a node. HA cluster software uses these control # networks for communication between nodes. At least two control # networks should be specified for heartbeat messages and one # control network for failsafe control messages. # For each control network for the node, please add one more # control network section. # # Name of control network IP address. This IP address must be # configured on the network interface in /etc/rc.config # file in the node. # It is recommended that the IP address in internet dot notation # is provided. # Example value: 192.26.50.3 # add nic 192.26.50.15 # # Flag to indicate if the control network can be used for sending # heartbeat messages. # Possible values: true, false # set heartbeat to true # # Flag to indicate if the control network can be used for sending # failsafe control messages. # Possible values: true, false # set ctrl_msgs to true # # Priority of the control network. Higher the priority value, lower the # priority of the control network. # Example value: 1 # set priority to 1 # # Control network information complete # done # # Add more control networks information here. # # Name of control network IP address. This IP address must be # configured on the network interface in /etc/rc.config # file in the node. # It is recommended that the IP address in internet dot notation # is provided. # Example value: 192.26.50.3 # add nic 150.166.41.61 # # Flag to indicate if the control network can be used for sending # heartbeat messages. # Possible values: true, false # set heartbeat to true # # Flag to indicate if the control network can be used for sending # failsafe control messages. # Possible values: true, false # set ctrl_msgs to false # # Priority of the control network. Higher the priority value, lower the # priority of the control network. # Example value: 1 # set priority to 2 # # Control network information complete # done # # Node definition complete # done # # Define (create) the cluster. # Information to create the cluster is obtained from template script: # /usr/lib/failsafe/cmgr-templates/cmgr-create-cluster # # # Name of the cluster. # define cluster failsafe-cluster # # Notification command for the cluster. This is optional. If this # field is not specified, /usr/bin/mail command is used for # notification. Notification is sent when there is change in status of # cluster, node and resource group. # set notify_cmd to /usr/bin/mail # # Notification address for the cluster. This field value is passed as # argument to the notification command. Specifying the notification # command is optional and user can specify only the notification # address in order to receive notifications by mail. If address is # not specified, notification will not be sent. # Example value: failsafe_alias@sysadm.company.com set notify_addr to robinhood@sgi.com princejohn@sgi.com # # List of nodes added to the cluster. # Repeat the following line for each node to be added to the cluster. # Node should be already defined in the CDB and logical name of the # node has to be specified. add node sleepy # # Add more nodes to the cluster here. # add node grumpy # # Cluster definition complete # done # # Create failover policies # Information to create the failover policies is obtained from # template script: # /usr/lib/failsafe/cmgr-templates/cmgr-create-cluster # # # Create the first failover policy. # # # Name of the failover policy. # define failover_policy sleepy-primary # # Failover policy attribute. This field is mandatory. # Possible values: Auto_Failback, Controlled_Failback, Auto_Recovery, # InPlace_Recovery # set attribute to Auto_Failback set attribute to Auto_Recovery # # Failover policy script. The failover policy scripts have to # be present in # /usr/lib/failsafe/policies directory. This field is mandatory. # Example value: ordered (file name not the full path name). set script to ordered # # Failover policy domain. Ordered list of nodes in the cluster # separated by spaces. This field is mandatory. # set domain to sleepy grumpy # # Failover policy definition complete # done # # Create the second failover policy. # # # Name of the failover policy. # define failover_policy grumpy-primary # # Failover policy attribute. This field is mandatory. # Possible values: Auto_Failback, Controlled_Failback, Auto_Recovery, # InPlace_Recovery # set attribute to Auto_Failback set attribute to InPlace_Recovery # # Failover policy script. The failover policy scripts have # to be present in # /usr/lib/failsafe/policies directory. This field is mandatory. # Example value: ordered (file name not the full path name). set script to ordered # # Failover policy domain. Ordered list of nodes in the cluster # separated by spaces. This field is mandatory. # set domain to grumpy sleepy # # Failover policy definition complete # done # # Create the IP_address resources. # Information to create an IP_address resource is obtained from: # /usr/lib/failsafe/cmgr-templates/cmgr-create-resource-IP_address # # # If multiple resources of resource type IP_address have to be created, # repeat the following IP_address definition template. # # Name of the IP_address resource. The name of the resource has to # be IP address in the internet “.” notation. This IP address is used # by clients to access highly available resources. # Example value: 192.26.50.140 # define resource 150.166.41.179 of resource_type IP_address in cluster failsafe-cluster # # The network mask for the IP address. The network mask value is used # to configure the IP address on the network interface. # Example value: 0xffffff00 set NetworkMask to 0xffffff00 # # The ordered list of interfaces that can be used to configure the IP # address.The list of interface names are separated by comma. # Example value: eth0, eth1 set interfaces to eth1 # # The broadcast address for the IP address. # Example value: 192.26.50.255 set BroadcastAddress to 150.166.41.255 # # IP_address resource definition for the cluster complete # done # # Name of the IP_address resource. The name of the resource has to be # IP address in the internet “.” notation. This IP address is used by # clients to access highly available resources. # Example value: 192.26.50.140 # define resource 150.166.41.99 of resource_type IP_address in cluster failsafe-cluster # # The network mask for the IP address. The network mask value is used # to configure the IP address on the network interface. # Example value: 0xffffff00 set NetworkMask to 0xffffff00 # # The ordered list of interfaces that can be used to configure the IP # address. # The list of interface names are separated by comma. # Example value: eth0, eth1 set interfaces to eth1 # # The broadcast address for the IP address. # Example value: 192.26.50.255 set BroadcastAddress to 150.166.41.255 # # IP_address resource definition for the cluster complete # done # # Create the volume resources. # Information to create a volume resource is obtained from: # /usr/lib/failsafe/cmgr-templates/cmgr-create-resource-volume # # # If multiple resources of resource type volume have to be created, # repeat the following volume definition template. # # Name of the volume. The name of the volume has to be: # Example value: HA_vol (not /dev/xlv/HA_vol) # define resource bagheera of resource_type volume in cluster failsafe-cluster # # The user name of the device file name. This field is optional. If # this field is not specified, value ``root'' is used. # Example value: oracle set devname-owner to root # # The group name of the device file name. This field is optional. # If this field is not specified, value ``sys” is used. # Example value: oracle set devname-group to sys # # The device file permissions. This field is optional. If this # field is not specified, value ``666” is used. The file permissions # have to be specified in octal notation. See chmod(1) for more # information. # Example value: 666 set devname-mode to 666 # # Volume resource definition for the cluster complete # done # # Name of the volume. The name of the volume has to be: # Example value: HA_vol (not /dev/xlv/HA_vol) # define resource bhaloo of resource_type volume in cluster failsafe-cluster # # The user name of the device file name. This field is optional. If this # field is not specified, value “root” is used. # Example value: oracle set devname-owner to root # # The group name of the device file name. This field is optional. # If this field is not specified, value “sys” is used. # Example value: oracle set devname-group to sys # # The device file permissions. This field is optional. If this field is # not specified, value “666” is used. The file permissions # have to be specified in octal notation. See chmod(1) for more # information. # Example value: 666 set devname-mode to 666 # # Volume resource definition for the cluster complete # done # # Create the filesystem resources. # Information to create a filesystem resource is obtained from: # /usr/lib/failsafe/cmgr-templates/cmgr-create-resource-filesystem # # # filesystem resource type is for XFS filesystem only. # If multiple resources of resource type filesystem have to be created, # repeat the following filesystem definition template. # # Name of the filesystem. The name of the filesystem resource has # to be absolute path name of the filesystem mount point. # Example value: /shared_vol # define resource /haathi of resource_type filesystem in cluster failsafe-cluster # # The name of the volume resource corresponding to the filesystem. This # resource should be the same as the volume dependency, see below. # This field is mandatory. # Example value: HA_vol set volume-name to bagheera # # The options to be used when mounting the filesystem. This field is # mandatory. For the list of mount options, see fstab(4). # Example value: “rw” set mount-options to rw # # The monitoring level for the filesystem. This field is optional. If # this field is not specified, value “1” is used. # Monitoring level can be # 1 - Checks if filesystem exists in the mtab file (see mtab(4)). This # is a lightweight check compared to monitoring level 2. # 2 - Checks if the filesystem is mounted using stat(1m) command. # set monitoring-level to 2 done # # Add filesystem resource type dependency # modify resource /haathi of resource_type filesystem in cluster failsafe-cluster # # The filesystem resource type definition also contains a resource # dependency on a volume resource. # This field is mandatory. # Example value: HA_vol add dependency bagheera of type volume # # filesystem resource definition for the cluster complete # done # # Name of the filesystem. The name of the filesystem resource has # to be absolute path name of the filesystem mount point. # Example value: /shared_vol # define resource /sherkhan of resource_type filesystem in cluster failsafe-cluster # # The name of the volume resource corresponding to the filesystem. This # resource should be the same as the volume dependency, see below. # This field is mandatory. # Example value: HA_vol set volume-name to bhaloo # # The options to be used when mounting the filesystem. This field is # mandatory.For the list of mount options, see fstab(4). # Example value: “rw” set mount-options to rw # # The monitoring level for the filesystem. This field is optional. If # this field is not specified, value “1” is used. # Monitoring level can be # 1 - Checks if filesystem exists in the mtab file (see mtab(4)). This # is a lightweight check compared to monitoring level 2. # 2 - Checks if the filesystem is mounted using stat(1m) command. # set monitoring-level to 2 done # # Add filesystem resource type dependency # modify resource /sherkhan of resource_type filesystem in cluster failsafe-cluster # # The filesystem resource type definition also contains a resource # dependency on a volume resource. # This field is mandatory. # Example value: HA_vol add dependency bhaloo of type volume # # filesystem resource definition for the cluster complete # done # # Create the statd resource. # Information to create a filesystem resource is obtained from: # /usr/lib/failsafe/cmgr-templates/cmgr-create-resource-statd # # # If multiple resources of resource type statd have to be created, # repeat the following filesystem definition template. # # Name of the statd. The name of the resource has to be the location # of the NFS/lockd directory. # Example value: /disk1/statmon # define resource /haathi/statmon of resource_type statd in cluster failsafe-cluster # # The IP address on which the NFS clinets connect, this resource should # be the same as the IP_address dependency, see below. # This field is mandatory. # Example value: 128.1.2.3 set InterfaceAddress to 150.166.41.99 done # # Add the statd resource type dependencies # modify resource /haathi/statmon of resource_type statd in cluster failsafe-cluster # # The statd resource type definition also contains a resource # dependency on a IP_address resource. # This field is mandatory. # Example value: 128.1.2.3 add dependency 150.166.41.99 of type IP_address # # The statd resource type definition also contains a resource # dependency on a filesystem resource. It defines the location of # the NFS lock directory filesystem. # This field is mandatory. # Example value: /disk1 add dependency /haathi of type filesystem # # statd resource definition for the cluster complete # done # # Create the NFS resources. # Information to create a NFS resource is obtained from: # /usr/lib/failsafe/cmgr-templates/cmgr-create-resource-NFS # # # If multiple resources of resource type NFS have to be created, repeat # the following NFS definition template. # # Name of the NFS export point. The name of the NFS resource has to be # export path name of the filesystem mount point. # Example value: /disk1 # define resource /haathi of resource_type NFS in cluster failsafe-cluster # # The export options to be used when exporting the filesystem. For the # list of export options, see exportfs(1M). # This field is mandatory. # Example value: “rw,wsync,anon=root” set export-info to rw # # The name of the filesystem resource corresponding to the export # point. This resource should be the same as the filesystem dependency, # see below. # This field is mandatory. # Example value: /disk1 set filesystem to /haathi done # # Add the resource type dependency # modify resource /haathi of resource_type NFS in cluster failsafe-cluster # # The NFS resource type definition also contains a resource dependency # on a filesystem resource. # This field is mandatory. # Example value: /disk1 add dependency /haathi of type filesystem # # The NFS resource type also contains a pseudo resource dependency # on a statd resource. You really must have a statd resource associated # with a NFS resource, so the NFS locks can be failed over. # This field is mandatory. # Example value: /disk1/statmon add dependency /haathi/statmon of type statd # # NFS resource definition for the cluster complete # done # # Name of the NFS export point. The name of the NFS resource has to be # export path name of the filesystem mount point. # Example value: /disk1 # define resource /sherkhan of resource_type NFS in cluster failsafe-cluster # # The export options to be used when exporting the filesystem. For the # list of export options, see exportfs(1M). # This field is mandatory. # Example value: “rw,wsync,anon=root” set export-info to rw # # The name of the filesystem resource corresponding to the export # point. This # resource should be the same as the filesystem dependency, see below. # This field is mandatory. # Example value: /disk1 set filesystem to /sherkhan done # # Add the resource type dependency # modify resource /sherkhan of resource_type NFS in cluster failsafe-cluster # # The NFS resource type definition also contains a resource dependency # on a filesystem resource. # This field is mandatory. # Example value: /disk1 add dependency /sherkhan of type filesystem # # The NFS resource type also contains a pseudo resource dependency # on a statd resource. You really must have a statd resource associated # with a NFS resource, so the NFS locks can be failed over. # This field is mandatory. # Example value: /disk1/statmon add dependency /haathi/statmon of type statd # # NFS resource definition for the cluster complete # done # # Create the Netscape_web resource. # Information to create a Netscape_web resource is obtained from: # /usr/lib/failsafe/cmgr-templates/cmgr-create-resource-Netscape_web # # # If multiple resources of resource type Netscape_web have to be # created, repeat the following filesystem definition template. # # Name of the Netscape WEB server. The name of the resource has to be # a unique identifier. # Example value: ha80 # define resource web-server of resource_type Netscape_web in cluster failsafe-cluster # # The locations of the servers startup and stop scripts. # This field is mandatory. # Example value: /usr/ns-home/ha86 set admin-scripts to /var/netscape/suitespot/https-control3 # # the TCP port number with the server listens on. # This field is mandatory. # Example value: 80 set port-number to 80 # # The desired monitoring level, the user can specify either; # 1 - checks for process existence # 2 - issues an HTML query to the server. # This field is mandatory. # Example value: 2 set monitor-level to 2 # # The locations of the WEB servers initial HTML page # This field is mandatory. # Example value: /var/www/htdocs set default-page-location to /var/www/htdocs # # The WEB servers IP address, this must be a configured IP_address # resource. # This resource should be the same as the IP_address dependency, see # below. # This field is mandatory. # Example value: 28.12.9.5 set web-ipaddr to 150.166.41.179 done # # Add the resource dependency # modify resource web-server of resource_type Netscape_web in cluster failsafe-cluster # # The Netscape_web resource type definition also contains a resource # dependency on a IP_address resource. # This field is mandatory. # Example value: 28.12.9.5 add dependency 150.166.41.179 of type IP_address # # Netscape_web resource definition for the cluster complete # done # # Create the resource groups. # Information to create a resource group is obtained from: # /usr/lib/failsafe/cmgr-templates/cmgr-create-resource_group # # # Name of the resource group. Name of the resource group must be unique # in the cluster. # define resource_group nfs-group in cluster failsafe-cluster # # Failover policy for the resource group. This field is mandatory. # Failover policy should be already defined in the CDB. # set failover_policy to sleepy-primary # # List of resources in the resource group. # Repeat the following line for each resource to be added to the # resource group. add resource 150.166.41.99 of resource_type IP_address # # Add more resources to the resource group here. # add resource bagheera of resource_type volume add resource bhaloo of resource_type volume add resource /haathi of resource_type filesystem add resource /sherkhan of resource_type filesystem add resource /haathi/statmon of resource_type statd add resource /haathi of resource_type NFS add resource /sherkhan of resource_type NFS # # Resource group definition complete # done # # Name of the resource group. Name of the resource group must be unique # in the cluster. # define resource_group web-group in cluster failsafe-cluster # # Failover policy for the resource group. This field is mandatory. # Failover policy should be already defined in the CDB. # set failover_policy to grumpy-primary # # List of resources in the resource group. # Repeat the following line for each resource to be added to the # resource group. add resource 150.166.41.179 of resource_type IP_address # # Add more resources to the resource group here. # add resource web-server of resource_type Netscape_web # # Resource group definition complete # done # # Script complete. This should be last line of the script # quit |