This procedure describes how to use the scrgadm(1M) command to register and configure the Sun Cluster HA for iPlanet Web Server data service.
Other options also enable you to register and configure the data service. See "Tools for Data-Service Resource Administration" for details about these options.
To perform this procedure, you must have the following information.
The name of the resource type for the Sun Cluster HA for iPlanet Web Server data service. This name is SUNW.iws.
The names of the cluster nodes that master the data service. For a failover service, only one node can master a data service at a time.
The logical hostname (for failover services) or shared address (for scalable services) that clients use to access the data service.
The path to the iPlanet binaries. You can install the binaries on the local disks or the cluster file system. See "Determining the Location of the Application Binaries" for a discussion of the advantages and disadvantages of each location.
The Network_resources_used setting on the iPlanet application resource determines the set of IP addresses that iPlanet Web Server uses. The Port_list setting on the resource determines the list of port numbers that iPlanet Web Server uses. The fault monitor assumes that the iPlanet Web Server daemon is listening on all combinations of IP and port. If you have customized your magnus.conf file for the iPlanet Web Server to listen on different port numbers (in addition to port 80), your resultant magnus.conf file must contain all possible combinations of IP address and ports. The fault monitor attempts to probe all such combinations and starts to fail if the iPlanet Web Server is not listening on a particular IP address-port combination. If the iPlanet Web Server does not serve all IP address-port combinations, you must break the iPlanet Web Server into separate instances that do.
Perform this procedure on any cluster member.
Become superuser on a cluster member.
Register the resource type for the Sun Cluster HA for iPlanet Web Server data service.
# scrgadm -a -t SUNW.iws |
Adds the data-service resource type.
Specifies the predefined resource-type name for your data service.
Create a failover resource group to hold the network and application resources.
For failover services, this resource group also holds the application resources.
You can optionally select the set of nodes on which the data service can run with the -h option.
# scrgadm -a -g resource-group [-h nodelist] |
Specifies the name of the failover resource group. This name can be your choice but must be unique for resource groups within the cluster.
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.
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.
Verify that all network addresses that you 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.
To avoid any failures because of name-service lookup, ensure that all logical hostnames and shared addresses 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+.
Add a network resource (logical hostname or shared address) to the failover resource group.
# scrgadm -a {-S | -L} -g resource-group \ -l network-resource,... [-j resource] \ [-X auxnodelist=node, ...] [-n netiflist] |
You use -S for shared-address resources or -L for logical-hostname resources.
Specifies the name of the failover resource group.
Specifies a comma-separated list of network resources to add. You can use the -j option to specify a name for the resources. If you do not do so, the network resources have the name of the first entry on the list.
Specifies an optional resource name. If you do not supply this name, the name of the network resource defaults to the first name specified after the -l option.
Specifies an optional comma-separated list of physical node IDs that identify cluster nodes that can host the shared address but never serve as a primary if failover occurs. These nodes are mutually exclusive with the nodes identified in nodelist for the resource group, if specified.
Specifies an optional comma-separated list that identifies the NAFO groups on each node. All nodes in nodelist of the resource group must be represented in netiflist. If you do not specify this option, scrgadm attempts to discover a net adapter on the subnet that the hostname list identifies for each node in nodelist.
For scalable services only - Create a scalable resource group to run on all desired nodes of the cluster.
If you run the Sun Cluster HA for iPlanet Web Server data service as a failover data service, do not perform this step-go to Step 8.
Create a resource group to hold a data-service application resource. You must specify the maximum and desired number of primary nodes, as well as a dependency between this resource group and the failover resource group that you created in Step 3. This dependency ensures that in the event of failover, the resource manager starts the network resource before starting any data services that depend on the network resource.
# scrgadm -a -g resource-group \ -y Maximum_primaries=m -y Desired_primaries=n \ -y RG_dependencies=resource-group |
Specifies the maximum number of active primary nodes allowed for this resource group. If you do not assign a value to this property, the default is 1.
Specifies the desired number of active primary nodes allowed for this resource group. If you do not assign a value to this property, the default is 1.
Identifies the resource group that contains the shared-address resource on which the resource group being created depends.
For scalable services only - Create an application resource in the scalable resource group.
If you run the Sun Cluster HA for iPlanet Web Server data service as a failover data service, do not perform this step-go to Step 8.
You can repeat this step to add multiple application resources (such as secure and insecure versions) to the same resource group.
You might also want to set load balancing for the data service. To do so, use the two standard resource properties Load_balancing_policy and Load_balancing_weights. See Appendix A, Standard Properties for a description of these properties. Additionally, see the examples that follow this section.
# scrgadm -a -j resource -g resource-group \ -t resource-type -y Network_resources_used=network-resource, ... \ -y Port_list=port-number/protocol, ... -y Scalable=True \ -x Confdir_list=config-directory, ... |
Specifies the name of the resource to add.
Specifies the name of the scalable resource group into which the resources are to be placed.
Specifies the type of the resource to add.
Specifies a comma-separated list of network resources that identify the shared addresses that the data service uses.
Specifies a comma-separated list of port numbers and protocol to be used, for example, 80/tcp,81/tcp.
Specifies a Boolean that is required for scalable services.
Specifies a comma-separated list of the locations of the iPlanet configuration files. The Sun Cluster HA for iPlanet Web Server data service requires this extension property.
A one-to-one mapping applies for Confdir_List and Port_List, that is, each of the values in one list must correspond to the values in the other list in the order specified.
For failover services only - Create an application resource in the failover resource group.
Perform this step only if you run the Sun Cluster HA for iPlanet Web Server data service as a failover data service. If you run the Sun Cluster HA for iPlanet Web Server data service as a scalable service, you must have performed Step 6 and Step 7 previously and must now go to Step 10.
You can repeat this step to add multiple application resources (such as secure and insecure versions) to the same resource group.
# scrgadm -a -j resource -g resource-group \ -t resource-type -y Network_resources_used=logical-hostname-list \ -y Port_list=port-number/protocol \ -x Confdir_list=config-directory |
Specifies the name of the resource to add.
Specifies the name of the failover resource group into which the resources are to be placed.
Specifies the type of the resource to add.
Specifies a comma-separated list of network resources that identify the logical hosts that the data service uses.
Specifies the port number and protocol to use, for example, 80/tcp. Port_list for failover services must have exactly one entry only because of the one-to-one mapping rule between Port_list and Confdir_list.
Specifies the location of the iPlanet configuration files. The Confdir_list file for failover services must have exactly one entry only. The config-directory must contain a directory called config. The Sun Cluster HA for iPlanet Web Server data service requires this extension property.
Optionally, you can set additional extension properties that belong to the iPlanet data service to override the default value. See Table 3-2 for a list of these properties.
Bring the failover resource group online.
# scswitch -Z -g resource-group |
Enables the network resource and fault monitoring, switches the resource group into a managed state, and brings the resource group online.
Specifies the name of the failover resource group.
For scalable services only - Bring the scalable resource group online.
# scswitch -Z -g resource-group |
Enables the resource and monitor, moves the resource group to the managed state, and brings the resource group online.
Specifies the name of the scalable resource group.
The following example shows how to register a scalable iPlanet service.
Cluster Information Node names: phys-schost-1, phys-schost-2 Shared address: schost-1 Resource groups: sa-resource-group-1 (for shared addresses), iws-resource-group-1 (for scalable iPlanet application resources) Resources: schost-1 (shared address), iplanet-insecure-1 (insecure iPlanet application resource), iplanet-secure-1 (secure iPlanet application resource) (Add a failover resource group to contain shared addresses.) # scrgadm -a -g sa-resource-group-1 (Add the shared address resource to the failover resource group.) # scrgadm -a -S -g sa-resource-group-1 -l schost-1 (Add a scalable resource group.) # scrgadm -a -g iws-resource-group-1 -y Maximum_primaries=2 \ -y Desired_primaries=2 -y RG_dependencies=sa-resource-group-1 (Register the iPlanet resource type.) # scrgadm -a -t SUNW.iws (Add an insecure iPlanet instance with default load balancing.) # scrgadm -a -j iplanet-insecure-1 -g iws-resource-group-1 -t SUNW.iws \ -x Confdir_List=/opt/iplanet/https-iplanet-insecure-1 \ -y Scalable=True -y Network_resources_used=schost-1 -y Port_list=80/tcp (Add a secure iPlanet instance with sticky IP load balancing.) # scrgadm -a -j iplanet-secure-1 -g iws-resource-group-1 -t SUNW.iws \ -x Confdir_List=/opt/iplanet/https-iplanet-secure-1 \ -y Scalable=True -y Network_resources_used=schost-1 \ -y Port_list=443/tcp -y Load_balancing_policy=LB_STICKY \ -y Load_balancing_weight=40@1,60@2 (Bring the failover resource group online.) # scswitch -Z -g sa-resource-group-1 (Bring the scalable resource group online.) # scswitch -Z -g iws-resource-group-1 |
The following example shows how to register a failover iPlanet service on a two-node cluster.
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), iplanet-insecure-1 (insecure iPlanet application resource), iplanet-secure-1 (secure iPlanet application resource) (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 (Register the iPlanet resource type.) # scrgadm -a -t SUNW.iws (Add an insecure iPlanet application resource instance.) # scrgadm -a -j iplanet-insecure-1 -g resource-group-1 -t SUNW.iws \ -x Confdir_list=/opt/iplanet/conf -y Scalable=False \ -y Network_resources_used=schost-1 -y Port_list=80/tcp\ (Add a secure iPlanet application resource instance.) # scrgadm -a -j iplanet-secure-1 -g resource-group-1 -t SUNW.iws \ -x Confdir_List=/opt/iplanet/https-iplanet-secure-1 -y Scalable=False \ -y Network_resources_used=schost-1 -y Port_list=443/tcp \ (Bring the failover resource group online.) # scswitch -Z -g resource-group-1 |