Sun Cluster Data Service for Sun Java System Web Server Guide for Solaris OS

Registering and Configuring Sun Cluster HA for Sun Java System Web Server

You can configure Sun Cluster HA for Sun Java System Web Server as a failover data service or as a scalable data service. You must include some additional steps to configure Sun Java System Web Server as a scalable data service. In the first procedure in this section, these additional steps begin with a notation that they are required for scalable services only. Individual examples of a failover service and a scalable service follow the procedure.

How to Register and Configure Sun Cluster HA for Sun Java System Web Server

This section describes how to register and configure Sun Cluster HA for Sun Java System Web Server.

This procedure describes how to use the scrgadm(1M) command to register and configure Sun Cluster HA for Sun Java System Web Server.


Note –

Other options also enable you to register and configure the data service. See “Tools for Data Service Resource Administration” in Sun Cluster Data Services Planning and Administration Guide for Solaris OS for details about these options.


To perform this procedure, you must have the following information.


Note –

Perform this procedure on any cluster member.


  1. Become superuser on a cluster member.

  2. Register the resource type for Sun Cluster HA for Sun Java System Web Server.


    # scrgadm -a -t SUNW.iws
    
    -a

    Adds the data service resource type.

    -t SUNW.iws

    Specifies the predefined resource type name for your data service.

  3. 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]
    -g resource-group

    Specifies the name of the failover resource group. This name can be your choice but must be unique for resource groups within the cluster.

    -h nodelist

    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 -h 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 of the 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 Software Installation Guide for Solaris OS for details.


    Note –

    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/inet/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+.


  5. 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]
    -S | -L

    You use -S for shared address resources or -L for logical hostname resources.

    -g resource-group

    Specifies the name of the failover resource group.

    -l network-resource, …

    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.

    -j resource

    Specifies an optional resource name. If you do not supply this name, the name of the network resource defaults to the first name that is specified after the -l option.

    -X auxnodelist=node, …

    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.

    -g resource-group

    Specifies the name of the resource group. This name can be your choice but must be unique for 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.

    -n netiflist

    Specifies an optional, comma-separated list that identifies the IP Networking Multipathing groups that are on each node. Each element in netiflist must be in the form of netif@node. netif can be given as an IP Networking Multipathing group name, such as sc_ipmp0. The node can be identified by the node name or node ID, such as sc_ipmp0@1 or sc_ipmp@phys-schost-1.


    Note –

    Sun Cluster does not currently support using the adapter name for netif.


  6. For scalable services only – Create a scalable resource group to run on all of the desired cluster nodes.

    If you run Sun Cluster HA for Sun Java System Web Server 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
    
    -y Maximum_primaries=m

    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.

    -y Desired_primaries=n

    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.

    -y RG_dependencies= resource-group

    Identifies the resource group that contains the shared address resource on which the resource group being created depends.

  7. For scalable services only – Create an application resource in the scalable resource group.

    If you run Sun Cluster HA for Sun Java System Web Server 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 “Standard Properties” in Sun Cluster Data Services Planning and Administration Guide for Solaris OS 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, …
    -j resource

    Specifies the name of the resource to add.

    -g resource-group

    Specifies the name of the scalable resource group into which the resources are to be placed.

    -t resource-type

    Specifies the type of the resource to add.

    -y Network_resources_used= network-resource, …

    Specifies a comma-separated list of network resources that identify the shared addresses that the data service uses.

    -y Port_list=port-number/protocol, …

    Specifies a comma-separated list of port numbers and protocol to be used, for example, 80/tcp,81/tcp.

    -y Scalable=True

    Specifies a Boolean that is required for scalable services.

    -x Confdir_list=config-directory, …

    Specifies a comma-separated list of the locations of the Sun Java System configuration files. Sun Cluster HA for Sun Java System Web Server requires this extension property.


    Note –

    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.


  8. For failover services only – Create an application resource in the failover resource group.

    Perform this step only if you run Sun Cluster HA for Sun Java System Web Server as a failover data service. If you run Sun Cluster HA for Sun Java System Web Server 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
    
    -j resource

    Specifies the name of the resource to add.

    -g resource-group

    Specifies the name of the failover resource group into which the resources are to be placed.

    -t resource-type

    Specifies the type of the resource to add.

    -y Network_resources_used=network-resource, …

    Specifies a comma-separated list of network resources that identify the logical hosts that the data service uses.

    -y Port_list=port-number/protocol

    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.

    -x Confdir_list=config-directory

    Specifies the location of the Sun Java System configuration files. The Confdir_list file for failover services must have exactly one entry only. The config-directory must contain a directory called config. Sun Cluster HA for Sun Java System Web Server requires this extension property.


    Note –

    Optionally, you can set additional extension properties that belong to the Sun Cluster HA for Sun Java System Web Server to override the default values of the properties. See Table 1–2 for a list of these properties.


  9. Bring the failover resource group online.


    # scswitch -Z -g resource-group
    
    -Z

    Enables the network resource and fault monitoring, switches the resource group into a MANAGED state, and brings the resource group online.

    -g resource-group

    Specifies the name of the failover resource group.

  10. For scalable services only – Bring the scalable 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 scalable resource group.

Example – Registering Scalable Sun Cluster HA for Sun Java System Web Server

The following example shows how to register a scalable Sun Cluster HA for Sun Java System Web Server.


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 application resources)
Resources: schost-1 (shared address), Sun-app-insecure-1 (insecure 
application resource), Sun-app-secure-1 (secure 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 resource type for the Sun Cluster HA for Sun Java System Web Server.)
# scrgadm -a -t SUNW.iws
 
(Add an insecure application instance with default load balancing.)
# scrgadm -a -j Sun-app-insecure-1 -g iws-resource-group-1 -t SUNW.iws \
-x Confdir_List=/opt/SunONE/https-Sun-app-insecure-1 \
-y Scalable=True -y Network_resources_used=schost-1 -y Port_list=80/tcp 

(Add a secure application instance with sticky IP load balancing.)
# scrgadm -a -j Sun-app-secure-1 -g iws-resource-group-1 -t SUNW.iws \
-x Confdir_List=/opt/SunONE/https-Sun-app-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_weights=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

Example – Registering Failover Sun Cluster HA for Sun Java System Web Server

The following example shows how to register a failover Sun Cluster HA for Sun Java System Web Server 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), Sun-app-insecure-1 (insecure application 
application resource), Sun-app-secure-1 (secure 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 resource type for the Sun Cluster HA for Sun Java System Web Server.)
# scrgadm -a -t SUNW.iws
 
(Add an insecure application resource instance.)
# scrgadm -a -j Sun-app-insecure-1 -g resource-group-1 -t SUNW.iws \
-x Confdir_list=/opt/SunONE/conf -y Scalable=False \
-y Network_resources_used=schost-1 -y Port_list=80/tcp\ 

(Add a secure application resource instance.)
# scrgadm -a -j Sun-app-secure-1 -g resource-group-1 -t SUNW.iws \ 
-x Confdir_List=/opt/SunONE/https-Sun-app-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

How to Configure SUNW.HAStoragePlus Resource Type

The SUNW.HAStoragePlus resource type was introduced in Sun Cluster 3.0 5/02. This new resource type performs the same functions as SUNW.HAStorage, and synchronizes actions between HA storage and the data service.

SUNW.HAStoragePlus also has an additional feature to make a local file system highly available.

See the SUNW.HAStoragePlus(5) man page and “Relationship Between Resource Groups and Disk Device Groups” in Sun Cluster Data Services Planning and Administration Guide for Solaris OS for background information. See “Synchronizing the Startups Between Resource Groups and Disk Device Groups” in Sun Cluster Data Services Planning and Administration Guide for Solaris OS for the procedure. (If you are using a Sun Cluster 3.0 version prior to 5/02, you must set up SUNW.HAStorage instead of SUNW.HAStoragePlus. See “Synchronizing the Startups Between Resource Groups and Disk Device Groups” in Sun Cluster Data Services Planning and Administration Guide for Solaris OS for New Resources for the procedure.)