A cluster alias is an IP address that makes some or all of the systems in a cluster look like a single system to clients rather than individual systems. A cluster can have more than one cluster alias. The default cluster alias includes all members of a cluster, and all members can receive packets addressed to this alias.
This chapter provides examples of multi-instance applications that use the default cluster alias to distribute requests among all cluster members. See the TruCluster Server Cluster Administration manual for information on how to modify alias attributes.
This chapter covers the following topics:
When to use cluster aliasing (Section 3.1)
Example applications (Section 3.2 and Section 3.3)
3.1 When to Use Cluster Aliasing
Because a cluster alias sends requests and packets to members of
aliases, it is most useful for applications that run on more than one
cluster member.
Incoming packets or connection requests are distributed
among members of a cluster alias.
If one member belonging to that alias
fails, the cluster alias software transparently routes
application-related traffic to the remaining members of the cluster alias.
Any new requests will go to the next member.
(See the TruCluster Server
Cluster Administration
manual for a summary of the cluster alias features.)
Figure 3-1
shows how the cluster alias subsystem
distributes client requests.
Figure 3-1: Accessing a Multi-Instance Application Through a Cluster Alias
For single-instance applications, use the cluster application
availability (CAA) facility for application control and failover.
The
cluster alias subsystem still routes packets addressed to an alias, but
because CAA ensures that only one member is running the application, the
cluster alias will always route requests to that member.
See the
TruCluster Server
Cluster Administration
manual for a general discussion about the
differences between the cluster alias subsystem and CAA.
3.2 Using the Default Cluster Alias to Access a Multi-Instance Apache HTTP Server
To access a highly available, multi-instance Apache HTTP server using the default cluster alias to distribute requests among all cluster members, follow these steps:
Download the latest standard Apache distribution from
www.apache.org
and follow the site's
instructions for building and installing Apache in the
/usr/local/apache
directory.
Edit the
apache/conf/http.conf
configuration file to
set the
KeepAlive
parameter to off:
KeepAlive Off
The cluster alias routes client requests on a connection by connection
basis.
If you want to load balance requests on a request by request
basis using the
selw
and
selp
alias attributes, you should turn off the
KeepAlive
timer that keeps these connections
open.
If an existing TCP connection is kept open, client requests
to the Apache server daemons (httpds
) running on the
cluster will only use the cluster alias to obtain the first connection,
and most of the subsequent client requests will go to the member with which
that first connection was established.
Create member-specific subdirectories for Apache log files in the
/usr/local/apache
directory:
# mkdir -p /usr/local/apache/member1/logs # mkdir -p /usr/local/apache/member2/logs
Create a context-dependent symbolic link (CDSL) for the log directory:
# mkcdsl /usr/local/apache/{memb}/logs /usr/local/apache/logs
Note
If you are using the C shell, you must escape the braces in the
{memb}
string; that is:\{memb\}
. Otherwise, the braces are stripped by the shell. If you are using the Bourne shell or the Korn shell, you do not have to escape the braces.
Add the following entry to the cluster alias services file,
/etc/clua_services
:
http 80/tcp in_multi
Setting the
in_multi
attribute for port 80
means that the cluster alias subsystem will distribute connection
requests directed to the default cluster alias among all members
of the alias.
To reload service definitions, enter the following command on all members:
# cluamgr -f
On each member, start the Apache server daemon:
# /usr/local/apache/bin/httpd
3.3 Using the Default Cluster Alias to Access a Multi-Instance Netscape FastTrack Server
To access a highly available, multi-instance Netscape FastTrack server using the default cluster alias to distribute requests among all cluster members, follow these steps:
If the Netscape FastTrack server is not installed, unpack and install the Netscape FastTrack kit.
If the Netscape FastTrack server is already installed, locate the server home directory and any Netscape server start and stop scripts.
Configure Netscape to use the default cluster alias name. If you do not want to use the default cluster alias, see the TruCluster Server Cluster Administration manual for instructions on creating additional aliases.
Create member-specific subdirectories for Netscape log files in the
/usr/local/netscape
directory:
# mkdir -p /usr/local/netscape/member1/logs # mkdir -p /usr/local/netscape/member2/logs
Create a context-dependent symbolic link (CDSL) for the log directory:
# mkcdsl /usr/local/netscape/{memb}/logs /usr/local/netscape/logs
Add the following entry to the cluster alias services file,
/etc/clua_services
:
http 80/tcp in_multi
Setting the
in_multi
attribute for port 80
means that the cluster alias subsystem will distribute connection
requests directed to the default cluster alias among all members
of the alias.
To reload service definitions, enter the following command on all members:
# cluamgr -f
Change your directory to
/usr/opt/netscape/suitespot
and run the setup utility:
# cd /usr/opt/netscape/suitespot # ns-setup
This procedure sets up the Netscape Admin server and starts the Admin daemon. When prompted for the name of the server, enter the name of the default cluster alias.
Add the default cluster alias name to the list of allowed X server connections and connect to the Netscape Admin server:
# xhost +aliasname # netscape http://youraliasname.yourdomain:nnnn/
The nnnn value is the port number that you chose in step 5.
Optionally, you can allow additional nodes to connect to the Netscape Admin daemon as follows:
Click on the Admin Preference button.
When the screen is displayed, click on Superuser Access Control.
If you want to be able to connect all cluster members to the Netscape Admin server, add all members' IP addresses.
Click on Server Administration to return to the main screen.
Note
If you want to start the Netscape Admin daemon at boot time, create a
/sbin/rc3.d
link that points to/usr/opt/netscape/suitespot/start-admin
. If you do not plan to change your Netscape configuration, you do not need to start the Admin daemon.
Create the Netscape FastTrack server as follows:
In the Servers Supporting General Administration section, click on Create New Netscape Fast Track Server 3.01.
Set the default cluster alias as both the Server Name and the Server Identifier. You do not have to make any other changes. If you selected the cluster alias for the Netscape Admin server, all fields are already filled in correctly.
Click OK and then click Return to Server Admin. Note that you can create more than one server on a single system.
Start the Netscape FastTrack server.