Before you install the Sun Cluster HA for Apache data service, update the following information in the Apache configuration file httpd.conf.
The ServerName directive that contains the hostname - For the Sun Cluster HA for Apache data service to be highly available, you must set this directive to the name of the network address (logical hostname or shared address) that is used to access the server. The logical hostname or shared address should have been set up when the cluster was installed. If not, see the Sun Cluster 3.0 U1 Installation Guide for information on how to set up logical hostnames and shared addresses, and set one up now.
The BindAddress directive, which you must set to the logical host or shared address - Because you can configure the Apache software to bind to INADDR_ANY, if you plan to run multiple instances of the Apache data service or multiple data services on the same node, each instance must bind to a unique network resource and port number.
The ServerType directive - This directive must be set to standalone, the default.
The ServerRoot directive that specifies the top of the directory tree under which the server's conf and log subdirectories are typically located - This directive has no default.
If you use a cluster file system as the location for the server root, you need only install the Apache software on that single file system to make the software accessible to all the nodes that can run the data service. See the discussion on placement of the binary files in "Determining the Location of the Application Binaries".
You might have multiple instances that use a single Apache binary. The location of the configuration file is specified according to the Confdir_list resource property. The following example shows the location of the configuration file.
(Location of the Apache binaries - also the value of the Bin_dir property) /global/apache/bin (Location of configuration directories - Confdir_list property) /global/websites/dev/conf /global/websites/sqa/conf (Location of httpd.conf files) /global/websites/dev/conf/httpd.conf /global/websites/sqa/conf/httpd.conf |
Run the following commands to start up the instances by hand, as you might when you verify your setup. Also, when instructed by the Resource Group Manager (RGM), the data service in effect issues the following commands to start the instances.
# /global/apache/bin/httpd \ -f /global/websites/dev/conf/httpd.conf # /global/apache/bin/httpd \ -f /global/websites/sqa/conf/httpd.conf |
The DocumentRoot directive that specifies the location of the documentation root directory - This directive is a pointer to a location on the cluster file system, where the HTML documents are installed.
The ScriptAlias directive that contains the location on a cluster file system of the cgi-bin directory - This directive is a pointer to a location on the cluster file system, where the cgi-bin files are installed.
You must follow certain conventions when you configure URL mappings for the Web server. For example, when setting the CGI directory, locate the CGI directory on the cluster file system to preserve availability. For example, you might map your CGI directory to /global/diskgroup/ServerRoot/cgi-bin, where diskgroup is the disk device group that contains the Apache software. In situations where the CGI programs access "back-end" servers, such as an RDBMS, ensure that the Sun Cluster software controls the "back-end" server. If the server is an RDBMS that the Sun Cluster software supports, use one of the highly available RDBMS packages. Alternatively, you can use the APIs that the Sun Cluster 3.0 U1 Data Services Developers' Guide documents to put the server under Sun Cluster control.
If you use a lock file - Set the value of the LockFile directive in your httpd.conf file to a local file.
Use a PidFile directive - Point this directive to a local file, as in the following example.
PidFile /usr/local/apache/log/httpd.pid |
The Port directive setting that the server port or ports access - The defaults are set in each node's httpd.conf file. The Port_list resource property must include all the ports specified in the httpd.conf files.
The Port_list property assumes that the Web server serves all combinations of ports and IP addresses from the network resources as defined in the Network_resources_used property.
Port_list="80/tcp,443/tcp,8080/tcp" |
The preceding Port_list configuration, for example, probes the following IP-port combinations.
Host |
Port | Protocol |
node1 |
80 |
tcp |
node1 |
443 |
tcp |
node1 |
8080 |
tcp |
node2 |
80 |
tcp |
node2 |
443 |
tcp |
node2 |
8080 |
tcp |
However, if node1 serves ports 80 and 443 only and node2 serves ports 80 and 8080 only, you can configure the Port_list property for Apache as follows.
Port_list=node1/80/tcp,node1/443/tcp,node2/80/tcp,node2/8080/tcp |
Consider the following rules.
You must specify hostnames or IP addresses (not network resource names) for node1 and node2.
If Apache serves nodeN/port for every nodeN in the Network_resources_used property, you can use a short form to replace the combination of node1/port1, node2/port2, and so on. See the following examples.
Example One
Port_list="80/tcp,node1/443/tcp,node2/8080/tcp" Network_resources_used=node1,node2 |
This example probes the following IP-port combinations.
Host |
Port | Protocol |
node1 |
80 |
tcp |
node1 |
443 |
tcp |
node2 |
80 |
tcp |
node2 |
8080 |
tcp |
Example Two
Port_list="node1/80/tcp,node2/80/tcp" Network_resources_used=net-1,net-2 #net-1 contains node1. #net-2 contains node2 and node3. |
This example probes the following IP-port combinations.
Host |
Port | Protocol |
node1 |
80 |
tcp |
node2 |
80 |
tcp |
All hostnames (IP addresses) that the Port_list property specifies must not belong to a network resource that is specified in any other scalable resource's Network_resources_used property. Otherwise, as soon as a scalable service detects that another scalable resource already uses an IP address, creation of the Apache resource fails.
If you are running the Sun Cluster HA for Apache data service and another HTTP server, configure the HTTP servers to listen on different ports. Otherwise, a port conflict can occur between the two servers.
To register and configure the Sun Cluster HA for Apache data service, you must consider or provide information on the following points.
Decide whether to run the Sun Cluster HA for Apache data service as a failover or a scalable service.
Decide which fault monitoring resource properties (such as the Thorough_probe_interval or Probe_timeout properties) to set. In most cases, the default values suffice. See "Configuring Sun Cluster HA for Apache Extension Properties" for information about these properties.
Provide the name of the resource type for the Sun Cluster HA for Apache data service. This name is SUNW.apache.
Provide the names of the cluster nodes that will master the data service.
Provide the logical hostname (failover services) or shared address (scalable services) that clients use to access the data service. You typically set up this IP address when you install the cluster. See the Sun Cluster 3.0 U1 Installation Guide for details on how to set up network addresses.
Provide the path to the application binaries. You can install the binaries on the local disks or on the cluster file system. See "Determining the Location of the Application Binaries" for a discussion of the advantages and disadvantages of each location.
Provide the path to the conf directory.
Exercise caution when changing the Load_balancing_weights property for an online scalable service that has the Load_balancing_policy property set to LB_STICKY or LB_STICKY_WILD. Changing these properties while the service is online can cause existing client affinities to be reset, hence a different node might service a subsequent client request even if another cluster member previously serviced the client.
Similarly, when a new instance of the service is started on a cluster, existing client affinities might be reset.
If a scalable proxy is serving a scalable Web resource with the LB_STICKY policy, you must also set up an LB_STICKY policy for the proxy.
Determine the entries for the Confdir_list and Port_list properties. For failover services, the Confdir_list property can have only one entry, but the Port_list property can have multiple entries. For scalable services, both properties can have multiple entries. See "How to Register and Configure Sun Cluster HA for Apache" for details.