6.3. Services

A cluster manages different services. UserCheck sections define the Application Stability Agents (ASAs) that will be used, and the Services section lists all the services and their settings.

6.3.1. UserCheck Settings

You can use the Application Stability Agents described in this section to ensure that services are still running. These are the same items that are configured in `Clustered Services' | `Application Stability Agents' in the turboclusteradmin program.

UserCheck ftp

  Up           /usr/local/bin/ftp-up

  Down         /usr/local/bin/ftp-down

  Check        /usr/bin/ftpAgent

EndUserCheck

The ASA name is given in the UserCheck line. Usually, you'll just use the name of the service. The name you use will be referenced in the Service lines in the following Services section.

The program (or script) name for ASA check is given in the Check line. Be sure to give the full path name. This program should perform a test transaction on the service and return a "1" if the transaction fails. The ASA will be called with the cluster node's IP address, port number, and socket type (1 for TCP, 2 for UDP).

The Up and Down scripts run when a service goes down or comes back up and are called with the same parameters as the ASA. In most cases you will not need to specify the Up and Down scripts. The Down script is most useful when used to try to bring back up a service that has gone down.

There are three predefined ASAs that do not need to be defined in the configuration file:

When an ASA is called, it will be called with several parameters, as in the following example:

/usr/bin/ftpAgent 192.168.0.7 23 1

In this example, the ASA is checking TCP port 23 on the cluster node with an IP address of 192.168.0.7.

6.3.2. Defining Services

The Services section defines all the network services that you will run on the cluster. There will be one line for each service.

Services

  Service ftp           tcp:21         ftp       sticky

  Service nntp          tcp:119        none

EndServices

The first parameter after the keyword Service is the name of the service. Then comes the port number, prefixed by either `tcp' or `udp'. Following that is the name of the Application Stability Agent, as given in the UserCheck section. Finally, optional flags are listed. The currently available flags are `sticky' and `failover'. The `sticky' flag indicates that this service should maintain persistent connections, connecting each client to the same server for every connection. The `failover' flag indicates that the service is not to use load balancing. One server will get all the traffic instead, unless it goes down. Then all traffic will be sent to the next server in the server pool.