Skip Navigation Links | |
Exit Print View | |
![]() |
Oracle Solaris Cluster Data Service for Apache Guide Oracle Solaris Cluster 4.0 |
1. Installing and Configuring Oracle Solaris Cluster HA for Apache
Planning the Installation and Configuration
Overview of the Installation and Configuration Process for Oracle Solaris Cluster HA for Apache
Installing and Configuring Apache
Installing a Non Secure Apache Web Server
How to Install and Configure the Apache Software From the Oracle Solaris CD-ROM
How to Install and Configure the Apache Software from the Apache Web Site
Installing the HA for Apache Package
How to Install the HA for Apache Package
Registering and Configuring Oracle Solaris Cluster HA for Apache
Setting Oracle Solaris Cluster HA for Apache Extension Properties
Example-- Setting Monitor_Uri_List for Scalable HA for Apache Instance
Example-- Setting Monitor_Uri_List for Failover HA for Apache Instance
Tools for Registering and Configuring HA for Apache
How to Register and Configure the Oracle Solaris Cluster HA for Apache by Using clsetup
Tuning the Oracle Solaris Cluster HA for Apache Fault Monitor
Operations by the Oracle Solaris Cluster HA for Apache Fault Monitor
Operations by the Fault Monitor Before a Probe
Operations for a Non Secure Web Server
Operations for a Monitored URI List
Upgrading the SUNW.apache Resource Type
Information for Registering the New Resource Type Version
Information for Migrating Existing Instances of the Resource Type
This section describes how to register and configure Oracle Solaris Cluster HA for Apache.
You can configure Apache as a failover service or as a scalable service, as follows.
When you configure Apache as a failover service, you place the Apache application resources and the network resources in a single resource group.
When you configure Apache as a scalable service, you create a scalable resource group for the Apache application resources and a failover resource group for the network resources.
The scalable resource group depends on the failover resource group. Additional steps are required to configure Apache as a scalable service. The leading text “For scalable services only” in the following procedure identifies these steps. If you are not configuring Apache as a scalable service, skip the steps marked “For scalable services only.”
The sections that follow contain instructions for registering and configuring Oracle Solaris Cluster HA for Apache resources. For information about the extension properties, see Appendix A, HA for Apache Extension Properties. The Tunable entry indicates when you can update a property.
See the rt_properties(5), r_properties(5), and rg_properties(5) man pages for details on all of the Oracle Solaris Cluster extension properties.
To set an extension property of a resource, include the following option in the clresource command that creates or modifies the resource:
-p property=value
Identifies the extension property that you are setting.
Specifies the value to which you are setting the extension property.
You can also use the procedures in Chapter 2, Administering Data Service Resources, in Oracle Solaris Cluster Data Services Planning and Administration Guide to configure resources after the resources are created.
Set the Monitor_Uri_List extension property if you want the web server fault monitor to probe an arbitrary list of applications (URIs) served by the web server. This extension property provides extended probing functionality and is useful if you are layering services in addition to your web server. If you do not set the Monitor_Uri_List extension property, the fault monitor will perform the basic probing. See Tuning the Oracle Solaris Cluster HA for Apache Fault Monitor for details. The following examples show how to set the Monitor_Uri_List extension property when you add the HA for Apache instance to your configuration.
(Add an insecure Apache instance with default load balancing.) # clresource create -g resource-group-1 \ -t SUNW.apache -p Bin_dir=/opt/apache/bin -p Resource_dependencies=schost-1, ... \ -p Monitor_Uri_list=http://schost-1:8000/servlet/monitor \ -p Scalable=True \ -p Port_list=8000/tcp apache-insecure-1
(Add an insecure Apache application resource instance.) # clresource create -g resource-group-1 \ -t SUNW.apache -p Bin_dir=/opt/apache/bin -p Resource_dependencies=schost-1 \ -p Monitor_Uri_list=http://schost-1:80/servlet/monitor \ -p Port_list=80/tcp apache-insecure-1
Oracle Solaris Cluster provides the following tools for registering and configuring HA for Apache:
The cLsetup utility. For more information, see How to Register and Configure the Oracle Solaris Cluster HA for Apache by Using clsetup and the clsetup(1CL) man page.
Oracle Solaris Cluster maintenance commands. For more information, see How to Register and Configure Oracle Solaris Cluster HA for Apache Using Oracle Solaris Cluster Command Line Interface (CLI).
The clsetup utility provides a wizard for configuring HA for Apache. The wizard reduces the possibility for configuration errors that might result from command syntax errors or omissions. The wizard also ensures that all required resources are created and that all required dependencies between resources are set.
Perform this procedure during your initial setup of Oracle Solaris Cluster HA for Apache. Perform this procedure from one node only.
Note - The clsetup utility can be used to configure Apache versions 1.x, Apache 2.2, and 2.2.16.
Before You Begin
Before you start the Oracle Solaris Cluster HA for Apache wizard, ensure that the following prerequisites are met:
You have decided whether to run Oracle Solaris Cluster HA for Apache as a failover service or a scalable service.
Prerequisites for configuring the required type of network resource are met.
The type of network resource that is required depends on your configuration of Oracle Solaris Cluster HA for Apache:
A failover service requires a logical hostname resource.
A scalable service requires a shared address resource.
The Apache software is installed and configured.
The Apache configuration files are available on the node where you will start the wizard.
The Oracle Solaris Cluster HA for Apache package is installed.
# clsetup
The clsetup main menu is displayed.
The Data Services menu is displayed.
The clsetup utility displays information about Oracle Solaris Cluster HA for Apache.
The clsetup utility displays a list of configuration modes for Oracle Solaris Cluster HA for Apache.
The clsetup utility displays a list of available nodes.
Ensure that the nodes are listed in the order in which the nodes are to appear in the resource group's node list. The first node in the list is the primary node of this resource group.
Ensure that the nodes are listed in the order in which the nodes are to appear in the resource group's node list.
The clsetup utility displays a screen where you can specify the location of the Oracle Solaris Cluster HA for Apache configuration file.
Note - The configuration file that you select here is used as a template. A new configuration file will be created using this template configuration file.
The clsetup utility displays a screen where you can specify the Oracle Solaris Cluster HA for Apache document root directory.
The clsetup utility displays a screen where you can specify the Oracle Solaris Cluster HA for Apache mount point.
The clsetup utility displays a screen where you can specify the Oracle Solaris Cluster HA for Apache network resource.
The clsetup utility displays information about the Oracle Solaris Cluster HA for Apache configuration that the utility will create.
The clsetup utility displays information about the Oracle Solaris Cluster objects that the utility will create.
Note - The document root specified by you will be copied to the one that is mentioned in the screen. The configuration file specified by you will be edited and the edited file will be stored in the location mentioned in the screen.
The clsetup utility displays information about the Oracle Solaris Cluster configuration that the utility will create.
The clsetup utility displays a progress message to indicate that the utility is running commands to create the configuration. When configuration is complete, the clsetup utility displays the commands that the utility ran to create the configuration.
Note - The clsetup utility will roll back the changes if it fails to complete the Apache configuration process.
The clsetup utility returns you to the list of options for configuring Oracle Solaris Cluster HA for Apache.
If you prefer, you can leave the clsetup utility running while you perform other required tasks before using the utility again. If you choose to quit clsetup, the utility recognizes your Oracle Solaris Cluster HA for Apache resource group when you restart the utility.
Use the clresourcegroup(1CL) command for this purpose. By default, the clsetup utility assigns the name apache-server-rg to the Oracle Solaris Cluster HA for Apache resource group.
# clresourcegroup status apache-server-rg
# clresourcegroup online -emM apache-server-rg
Complete the registration and configuration on any cluster member.
Before You Begin
Verify that all the network addresses that you use have been added to your name service database.
You should have performed this verification during your initial Oracle Solaris Cluster installation. See the planning chapter in the Oracle Solaris Cluster Software Installation Guide for details.
Note - To avoid failures because of name service lookup, verify that all the network addresses are present in the /etc/inet/hosts file on all of the cluster nodes. Configure name service mapping on the servers to first check the local files before accessing NIS, NIS+, or DNS:
/usr/sbin/svccfg -s svc:/system/name-service/switch setprop config/host = astring: \” cluster files nis\”
# clresourcetype register SUNW.apache
This resource group is required for both failover and scalable services. For failover services, the resource group contains both network and failover application resources. For scalable services, the resource group contains network resources only. A dependency is created between this group and the resource group that contains the application resources.
Optionally, you can select the set of nodes on which the data service can run with the -n option.
# clresourcegroup create [-n node-list] resource-group
Specifies the name of the failover resource group to add. This name can be your choice but must be unique for the resource groups within the cluster.
Specifies a comma-separated, ordered list of nodes that can master this resource group. In this format, node specifies the node name in a global zone.
This list is optional. If you omit this list, the global zone of each cluster node can master the resource group.
# clressharedaddress create -g resource-group \ -h hostname,... [-N netiflist] resource
Specifies a comma-separated list of network resources to add.
Specifies the name of the failover resource group that you created in Step 3.
Specifies a resource name. If you do not supply your choice for a resource name, the name of the network resource defaults to the first name that is specified after the -h option.
Specifies an optional, comma-separated list that identifies the IPMP groups that are on each node or zone. The format of each entry in the list is netif@node. The replaceable items in this format are as follows:
Specifies an IPMP group name, such as sc_ipmp0, or a public network interface card (NIC). If you specify a public NIC, Oracle Solaris Cluster attempts to create the required IPMP groups.
Specifies the name or ID of a node. To specify the global zone, specify only node.
Note - If you require a fully qualified hostname, you must specify the fully qualified name with the -h option and you cannot use the fully qualified form in the resource name.
Note - Oracle Solaris Cluster does not currently support using the adapter name for netif.
If you run Oracle Solaris Cluster HA for Apache as a failover data service, proceed to Step 7.
Create a resource group to hold a data service application resource. You must specify the maximum and desired number of primary nodes.
Note - If only a subset of nodes can be primaries for this resource group, you must use the -n option to specify the names of these potential primaries when you create the resource group.
You must also specify any dependency between this resource group and the failover resource group that you created in Step 3. This dependency ensures that when failover occurs, if the two resource groups are being brought online on the same node, the Resource Group Manager (RGM) starts up the network resource before any data services that depend on the network resource.
# clresourcegroup create [-n node-zone-list] \ -p Maximum_primaries=m -p Desired_primaries=n \ -p RG_dependencies=resource-group resource-group
Specifies the name of the scalable service resource group to add.
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, that is, the name of the failover resource group that you created in Step 3.
Specifies a comma-separated, ordered list of nodes that can master this resource group. The format of each entry in the list is node. In this format, node specifies the node name. To specify the global zone, specify only node.
This list is optional. If you omit this list, the global zone of each cluster node can master the resource group.
If you run Oracle Solaris Cluster HA for Apache as a failover data service, proceed to Step 7.
# clresource create -g resource-group \ -t resource-type -p Bin_dir=bin-directory,... \ -p Resource_dependencies=network-resource,… \ -p Port_list=port-number/protocol[, …] \ -p Scalable=True resource
Specifies your choice for 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 resource names 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 required parameter for scalable services. This parameter must be set to True.
Specifies the location where the Apache binaries—in particular, apachectl—are installed. Oracle Solaris Cluster HA for Apache requires this extension property.
The resource is created in the enabled state.
Note - Optionally, you can set additional extension properties that belong to the Apache data service to override their default values. See Appendix A, HA for Apache Extension Properties for a list of extension properties.
Perform this step only if you run Oracle Solaris Cluster HA for Apache as a failover data service. If you run Oracle Solaris Cluster HA for Apache as a scalable data service, you should have performed Step 5 and Step 6 and should now proceed to Step 9.
# clresource create -g resource-group \ -t resource-type -p Bin_dir=bin-directory \ -p Resource_dependencies=network-resource,… \ -p Port_list=port-number/protocol[, …] resource
Specifies your choice for the name of the resource to add.
Specifies the name of the resource group you created inStep 3 where 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).
This property is required for scalable services only. Here the value is set to False or can be omitted.
Specifies the location where the Apache binaries—in particular, apachectl—are installed. Oracle Solaris Cluster HA for Apache requires this extension property.
The resource is created in the enabled state.
# clresourcegroup online -emM resource-group
Specifies the name of the failover resource group.
# clresourcegroup online -emM resource-group
Specifies the name of the scalable resource group.
Example 1-1 Registering Scalable Oracle Solaris Cluster HA for Apache
For scalable services, you create the following resource groups.
A failover resource group that contains the network resources
A scalable resource group that contains the application resources
The following example shows how to register a scalable Apache service on a two-node cluster.
Cluster Information Node names: phys-schost-1, phys-schost-2 Shared address: schost-1 Resource groups: resource-group-1 (for shared addresses), resource-group-2 (for scalable Apache application resources) Resources: schost-1 (shared address), apache-1 (Apache application resource) (Add a failover resource group to contain shared addresses.) # clresourcegroup create resource-group-1 (Add the shared address resource to the failover resource group.) # clressharedaddress create -g resource-group-1 -h schost-1 schost-1 (Register the Apache resource type.) # clresourcetype register SUNW.apache (Add a scalable resource group.) # clresourcegroup create -p Maximum_primaries=2 \ -p Desired_primaries=2 -p RG_dependencies=resource-group-1 resource-group-2 (Add Apache application resources to the scalable resource group.) # clresource create -g resource-group-2 \ -t SUNW.apache -p Bin_dir=/opt/apache/bin -p Resource_dependencies=schost-1 \ -p Scalable=True \ -p Port_list=80/tcp apache-1 (Bring the failover resource group online.) # clresourcegroup online -emM resource-group-1 (Bring the scalable resource group online on both nodes.) # clresourcegroup online -emM resource-group-2
Example 1-2 Registering Failover Oracle Solaris Cluster HA for Apache
The following example shows how to register a failover Apache 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 of the resources) Resources: schost-1 (logical hostname), apache-1 (Apache application resource) (Add a failover resource group to contain all of the resources.) # clresourcegroup create resource-group-1 (Add the logical hostname resource to the failover resource group.) # clreslogicalhostname create -g resource-group-1 -h schost-1 schost-1 (Register the Apache resource type.) # clresourcetype register SUNW.apache (Add Apache application resources to the failover resource group.) # clresource create -g resource-group-1 \ -t SUNW.apache -p Bin_dir=/opt/apache/bin -p Resource_dependencies=schost-1 \ -p Port_list=80/tcp apache-1 (Bring the failover resource group online.) # clresourcegroup online -emM resource-group-1
See the SUNW.HAStoragePlus(5) man page and Relationship Between Resource Groups and Device Groups in Oracle Solaris Cluster Data Services Planning and Administration Guide for background information. See Synchronizing the Startups Between Resource Groups and Device Groups in Oracle Solaris Cluster Data Services Planning and Administration Guide for the procedure.
After you configure Oracle Solaris Cluster HA for Apache, verify that you can open a web page with the network resources (logical hostnames or shared addresses) and port number from a web browser. Perform a switchover with the clresourcegroup command to verify that the service continues to run on a secondary node and can be switched back to the original primary.