5    Moving ASE Applications to TruCluster Server

This chapter describes how to move Available Server Environment (ASE) applications to TruCluster Server Version 5.1A.

To continue single-instance application availability and failover, TruCluster Server provides the cluster application availability (CAA) subsystem. Before moving ASE services to TruCluster Server, make sure that you are familiar with CAA. See Chapter 2 for detailed information on how to use CAA.

This chapter discusses the following topics:

5.1    Comparing ASE to CAA

CAA provides resource monitoring and application restart capabilities. It provides the same type of application availability that is provided by user-defined services in the TruCluster Available Server Software and TruCluster Production Server Software products. Table 5-1 compares ASE services with their equivalents in the TruCluster Server product.

Table 5-1:  ASE Services and Their TruCluster Server Equivalents

ASE Service ASE Description TruCluster Server Equivalent
Disk service (Section 5.1.1) One or more highly available file systems, Advanced File System (AdvFS) filesets, or Logical Storage Manager (LSM) volumes. Can also include a disk-based application. Cluster File System (CFS), device request dispatcher, and CAA
Network File System (NFS) service (Section 5.1.2) One or more highly available file systems, AdvFS filesets, or LSM volumes that are exported. Can also include highly available applications. Automatically provided by CFS and the default cluster alias. No service definition required.
User-defined service (Section 5.1.3) An application that fails over using action scripts. CAA
Distributed raw disk (DRD) service (Section 5.1.4) Allows a disk-based, user-level application to run within a cluster by providing clusterwide access to raw physical disks. Automatically provided by the device request dispatcher. No service definition required.
Tape service (Section 5.1.5) Depends on a set of one or more tape devices for configuring the NetWorker server and other servers for failover. CFS, device request dispatcher, and CAA

The following sections describe these ASE services and explain how to handle them in a TruCluster Server environment.

5.1.1    Disk Service

ASE

An ASE disk service includes one or more highly available file systems, Advanced File System (AdvFS) filesets, or Logical Storage Manager (LSM) volumes. Disk services can also include a disk-based application and are managed within the ASE.

TruCluster Server

The Cluster File System (CFS) makes all file storage available to all cluster members, and the device request dispatcher makes disk storage available clusterwide. Because file systems and disks are now available throughout the cluster, you do not need to mount and fail them over explicitly in your action scripts. For more information about using CFS, see the TruCluster Server Cluster Administration manual and cfsmgr(8).

Use CAA to define a disk service's relocation policies and dependencies. If you are not familiar with CAA, see Chapter 2.

Disk services can be defined to use either a cluster alias or an IP alias for client access.

5.1.2    NFS Service

ASE

An ASE Network File System (NFS) service includes one or more highly available file systems, AdvFS filesets, or LSM volumes that a member system exports to clients making the data highly available. NFS services can also include highly available applications.

TruCluster Server

When configured as an NFS server, a TruCluster Server cluster provides highly available access to the file systems it exports. CFS makes all file storage available to all cluster members. You no longer need to mount any file systems within your action scripts. Define the NFS file system to be served in the /etc/exports file, as you would on a standalone server.

Remote clients can mount NFS file systems that are exported from the cluster by using the default cluster alias or by using alternate cluster aliases.

5.1.3    User-Defined Service

ASE

An ASE user-defined service consists only of an application that you want to fail over using your own action scripts. The application in a user-defined service cannot use disks.

TruCluster Server

In ASE you may have created a highly available Internet login service by setting up user-defined start and stop action scripts that invoked ifconfig. In TruCluster Server you do not need to create a login service. Clients can log into the cluster by using the default cluster alias.

Use CAA to define a user-defined service's failover and relocation policies and dependencies. If you are not familiar with CAA, see Chapter 2.

5.1.4    DRD Service

ASE

An ASE distributed raw disk (DRD) service provides clusterwide access to raw physical disks. A disk-based, user-level application can run within a cluster, regardless of where in the cluster the physical storage it depends upon is located. A DRD service allows applications, such as database and transaction processing (TP) monitor systems, parallel access to storage media from multiple cluster members. When creating a DRD service, you specify the physical media that the service will provide clusterwide.

TruCluster Server

The device request dispatcher subsystem makes all disk and tape storage available to all cluster members, regardless of where the physical storage is located. You no longer need to explicitly fail over disks when an application fails over to another member.

Prior to Tru64 UNIX Version 5.0, a separate DRD namespace was provided in a TruCluster Production Server environment. As DRD services were added, the asemgr utility assigned DRD special file names sequentially in the following form:

/dev/rdrd/drd1
/dev/rdrd/drd2
/dev/rdrd/drd3

.
.
.

In a TruCluster Server cluster, you access a raw disk device partition in a TruCluster Server configuration in the same way that you do on a Tru64 UNIX Version 5.0 or later standalone system -- by using the device's special file name in the /dev/rdisk directory. For example:

/dev/rdisk/dsk2c
 

5.1.5    Tape Service

ASE

An ASE tape service depends on a set of one or more tape devices. It may also include media changer devices and file systems. A tape service enables you to configure the Legato NetWorker server and servers for other client/server-based applications for failover. The tape drives, media changers, and file systems all fail over as one unit.

TruCluster Server

CFS makes all file storage available to all cluster members, and the device request dispatcher makes disk and tape storage available clusterwide. Because file systems, disks, and tapes are now available throughout the cluster, you do not need to mount and fail them over explicitly in your action scripts.

Use CAA to define a tape service's failover and relocation policies and dependencies. If you are not familiar with CAA, see Chapter 2.

Tape services can be defined to use either a cluster alias or an IP alias for client access.

5.2    Preparing to Move ASE Services to TruCluster Server

As discussed in the TruCluster Server Cluster Installation manual, save both the var/ase/config/asecdb database and a text copy of the database before shutting down your TruCluster Available Server or TruCluster Production Server cluster. Having the ASE database content available makes it easier to set up applications on TruCluster Server.

How ASE database content is saved differs between versions of TruCluster Available Server and TruCluster Production Server. The following sections explain how to save ASE database content on different versions of TruCluster Server.

5.2.1    Saving ASE Database Content from TruCluster Available Server and Production Server Version 1.5 or Later

To save the /var/ase/config/asecdb database in ASCII format, enter the following asemgr command:

# asemgr -d -C > asecdb.txt
 

This command saves the ASE database content and outputs it in ASCII format to a file called asecdb.txt.

The following information, which is saved from a sample ASE database, is helpful when creating a CAA profile:

!! ASE service configuration for netscape
 
@startService netscape
Service name: netscape
Service type: DISK
Relocate on boot of favored member: no
Placement policy: balanced

.
.
.

The following information saved from a sample ASE database is helpful when installing and configuring an application on TruCluster Server:

IP address: 16.141.8.239
Device: cludemo#netscape
  cludemo#netscape mount point: /clumig/Netscape
  cludemo#netscape filesystem type: advfs
  cludemo#netscape mount options: rw
  cludemo#netscape mount point group owner: staff
Device: cludemo#cludemo
  cludemo#cludemo mount point: /clumig/cludemo
  cludemo#cludemo filesystem type: advfs
  cludemo#cludemo mount options: rw
  cludemo#cludemo mount point group owner: staff
AdvFS domain: cludemo
  cludemo volumes: /dev/rz12c

.
.
.

5.2.2    Saving ASE Database Content from TruCluster Available Server and Production Server Version 1.4 or Earlier

On a TruCluster Version 1.4 or earlier system, you cannot use the asemgr command to save all ASE service information. The asemgr command does not capture ASE script information. You must use the asemgr utility if you want to save all information.

To save script data, follow these steps:

  1. Start the asemgr utility.

  2. From the ASE Main Menu, choose Managing ASE Services.

  3. From the Managing ASE Services menu, choose Service Configuration.

  4. From the Service Configuration menu, choose Modify a Service.

  5. Select a service from the menu.

  6. Choose General service information.

  7. From the User-defined Service Modification menu, choose User-defined action scripts.

  8. Select Start action from the menu. Record the values for script argument and script timeout.

  9. From the menu, choose Edit the start action script.

    Write the internal script to a file on permanent storage where it will not be deleted.

Repeat these steps as necessary for all stop, add, and delete scripts. For user-defined services, also save the check script.

To save ASE database content and the rest of your ASE service information (placement policies, service names, and so on), enter the following commands:

# asemgr -dv > ase.services.txt
# asemgr -dv {ServiceName}
 

The name of the service, ServiceName, is taken from the output that is produced by asemgr -dv. Execute asemgr -dv {ServiceName} for each service.

5.3    ASE Script Considerations

Review ASE scripts carefully. Consider the following issues for scripts to work properly on TruCluster Server:

5.3.1    Replace ASE Commands with CAA Commands

In TruCluster Server Version 5.1A, the asemgr command is replaced by several CAA commands. The following table compares ASE commands with their equivalent CAA commands:

ASE Command CAA Command Description
asemgr -d caa_stat Provides status on CAA resources clusterwide
asemgr -m caa_relocate Relocates an application resource from one cluster member to another
asemgr -s caa_start Starts application resources
asemgr -x caa_stop Stops application resources
  caa_profile Creates, validates, deletes, and updates a CAA resource profile
  caa_register Registers a resource with CAA
  caa_unregister Unregisters a resource with CAA

The caa_profile, caa_register, and caa_unregister commands provide functionality that is unique to the TruCluster Server product. For information on how to use any of the CAA commands, see Chapter 2.

5.3.2    Combine Start and Stop Scripts

CAA does not call separate scripts to start and stop an application. If you have separate start and stop scripts for your application, combine them into one script. The following CAA script shows both start and stop entry points:

#!/usr/bin/ksh -p

.
.
.
# # Start section - start the process and report results # case $1 in 'start') echo "" >> ${LOG} echo ""Start action script for service : ${svcName} \ `/bin/date +"%A %d %B %H:%M:%S"` "" >> ${LOG}   echo "Starting $svcName ... " >> ${LOG} cd $APPDIR if [[ $START_APPCMD != "" ]] then $START_APPCMD >> ${LOG} if [ $? -ne 0 ]; then postevent "$svcName" start exit 2 fi fi   if [[ $START_APPCMD2 != "" ]] then $START_APPCMD2 if [$? -ne 0]; then postevent "$svcName" start exit 2 fi fi   echo "Started $svcName" >> ${LOG} # # Stop section - stop the process and report results # 'stop') echo "" >> ${LOG} echo ""Stop action script for service : ${svcName} \ `/bin/date +"%A %d %B %H:%M:%S"` "" >> ${LOG}   echo "Stopping $svcName ... " >> ${LOG} cd $APPDIR if [[ $STOP_APPCMD != "" ]] then $STOP_APPCMD >> ${LOG} if [ $? -ne 0 ]; then postevent "$svcName" stop exit 2 fi fi   if [[ $STOP_APPCMD2 != "" ]] then $STOP_APPCMD2 if [ $? -ne 0 ]; then postevent "$svcName" stop exit 2 fi fi # # Check section - check the process and report results # 'check') echo ""Probing $svcName at \ `/bin/date +"%A %d %B %H:%M:%S"`"" >> ${LOG} for i in ${PROBE_PROCS} do probeapp ${i} >> ${LOG} done echo ""Probing $svcName DONE at \ `/bin/date +"%A %d %B %H:%M:%S"`"" >> ${LOG} ;; *) echo "usage: $0 {start|stop|check}" exit 1 ;; esac  

5.3.3    Redirect Script Output

CAA scripts run with standard output and standard error streams directed to /dev/null. If you want to capture these streams, we recommend that you employ one of the following methods, in the following order of preference:

  1. Use the Event Manager (EVM) (as demonstrated in the template script /var/cluster/caa/template/template.scr). This is the preferred method because of the output management that EVM provides.

  2. Use the logger command to direct output to the system log file (syslog). See logger(1) for more information. This method is not as flexible as using EVM. For example, messages stored in syslog are simple text and cannot take advantage of the advanced formatting and searching capabilities of EVM.

  3. Direct output to /dev/console. This method does not have a persistent record; messages appear only at the console.

  4. Direct output to a file. With this method, be aware of log file size, and manage file space appropriately.

Sample CAA scripts that redirect output are available in the /cluster/caa/examples directory.

5.3.4    Replace nfs_ifconfig Script

In TruCluster Server there is no longer an nfs_ifconfig script as found in the TruCluster ASE. Replace nfs_ifconfig scripts with either an ifconfig alias/-alias statement in a CAA action script or use a cluster alias.

For more information about using an interface alias in a CAA script, see Section 5.4.1. See the the examples in Section 2.12 for information on using a cluster alias with CAA single-instance applications.

5.3.5    Handling Errors Correctly

Create scripts in TruCluster Server so that they handle errors properly. The "filesystem busy" message is no longer returned. Therefore, an application may be started twice, even if some of its processes are still active on another member.

Make sure that your stop script can stop all processes, or use fuser(8) to stop application processes.

5.3.6    Remove Storage Management Information

An ASE service's storage needed to be:

Because the Cluster File System (CFS) in TruCluster Server makes all file storage available to all cluster members (access to storage is built into the cluster architecture), you no longer need to manage file system mounting and failover within action scripts.

You can remove all storage management information from scripts on TruCluster Server. For example, SAP R/3 scripts may have been set up to mount file systems within their own scripts. You can remove these mount points.

5.3.7    Convert Device Names

As described in Section 4.2, scripts that reference old device names must be modified to use the new device-naming model that was introduced with Tru64 UNIX Version 5.0.

If you used the ase_fix_config command to renumber buses, save the output from the command during the upgrade and use it to verify physical devices against bus numbers. See the TruCluster Server Cluster Installation manual for information on how to run the ase_fix_config command.

5.3.8    Replace or Remove ASE Variables

ASE scripts may contain the following ASE environment variables:

5.3.9    Exit Codes

ASE exit codes for all scripts return 0 for success; anything else equals failure.

Each entry point of a CAA script returns an exit code of 0 for success and a nonzero value for failure. (Scripts that are generated by the caa_profile command from the script template return a 2 for failure.) For the check section of a CAA script, an exit code of 0 means that the application is running.

5.3.10    Posting Events

The Event Manager (EVM) provides a single point of focus for the multiple channels (such as log files) through which system components report event and status information. EVM combines these events into a single event stream, which the system administrator can monitor in real time or view as historical events retrieved from storage. Use the evmpost(8) command to post events into EVM from action scripts.

Note

The CAA sample scripts that are located in the /var/cluster/caa/examples directory use EVM to post events.

5.4    Networking Considerations

The following sections discuss networking issues to consider when moving ASE services to TruCluster Server:

5.4.1    Using an Alias

If an application requires the use of an alias, you can use either a cluster alias or an interface alias.

Using a cluster alias is most appropriate when:

Using an interface alias is the preferred mechanism when:

5.4.1.1    Cluster Alias

You must use cluster aliasing to provide client access to multi-instance network services. Because the TruCluster Server cluster alias subsystem creates and manages aliases on a clusterwide basis, you do not have to explicitly establish and remove interface aliases with the ifconfig command. See Chapter 3 for information about using cluster aliasing with multi-instance applications. See the TruCluster Server Cluster Administration manual for more information about how to use cluster aliasing in general.

You can use a cluster alias to direct client traffic to a single cluster member that is hosting a single-instance application, like the Oracle8i single server. When you configure a service under a cluster alias and set the in_single cluster alias attribute, the alias subsystem ensures that all client requests that are directed at that alias are routed to a cluster member that is running the requested service as long as it is available. However, for single-instance applications, consider using CAA for more control and flexibility in managing application failover. See Chapter 2 for information about using CAA.

Although you do not need to define NFS services in a TruCluster Server cluster to allow clients to access NFS file systems exported by the cluster, you may need to deal with the fact that clients know these services by the IP addresses that are provided by the ASE environment. Clients must access NFS file systems that are served by the cluster by using the default cluster alias.

5.4.1.2    Interface Alias

If a single-instance application cannot easily be converted to use a cluster alias, you can continue to use an interface alias by either modifying an existing nfs_ifconfig entry to use ifconfig(8), or add a call to ifconfig in a CAA action script.

When modifying a CAA action script, call ifconfig alias to assign an alias to an interface. Use the following command prior to starting up the application; otherwise, the application might not be able to bind to the alias address:

ifconfig interface_id alias alias_address netmask mask
 

To deassign an alias from an interface, call ifconfig -alias after all applications and processes have been stopped; otherwise, an application or process might not be able to continue to communicate with the interface alias.

The following example contains a section from an Apache CAA script:


.
.
.
# Assign an IP alias to a given interface IFCNFG_ALIAS_ADD="/sbin/ifconfig tu0 alias 16.141.8.118 netmask 255.255.255.0" # #Deassign an IP alias to an interface IFCNFG_ALIAS_DEL="/sbin/ifconfig tu0 -alias 16.141.8.118 netmask 255.255.255.0"
.
.
.
# Start section # case $1 in 'start') echo "" >> ${LOG} echo ""Start action script for service : ${svcName} \ `/bin/date +"%A %d %B %H:%M:%S"` "" >> ${LOG} # # Start Apache # echo "Starting Apache ... " >> ${LOG} cd $APPDIR # $IFCNFG_ALIAS_ADD >> ${LOG} if [ $? -ne 0 ]; then postevent "Apache IP Alias" start exit 2 fi # $START_APPCMD >> ${LOG} if [ $? -ne 0 ]; then postevent "Apache Server" start exit 2 fi echo "Started Apache Server" >> ${LOG} ;; # # Stop section # 'stop') echo "" >> ${LOG} echo ""Stop action script for service : ${svcName} \ `/bin/date +"%A %d %B %H:%M:%S"` "" >> ${LOG} # # Stop Apache # echo "Stopping Apache ... " >> ${LOG} $STOP_APPCMD >> ${LOG} if [ $? -ne 0 ]; then postevent "Apache Server" stop exit 2 fi # $IFCNFG_ALIAS_DEL >> ${LOG} if [ $? -ne 0 ]; then postevent "Apache IP Alias" stop exit 2 fi ;;
.
.
.
esac  

5.4.2    Networking Services

In the TruCluster Available Server Software and TruCluster Production Server Software products, the asemgr utility provided a mechanism to monitor client networks.

In Tru64 UNIX Version 5.0 or later, client network monitoring is a feature of the base operating system. The NetRAIN interface provides protection against certain kinds of network connectivity failures. The Network Interface Failure Finder (NIFF) is an additional feature that monitors the status of its network interfaces and reports indications of network failures. Applications that are running in a TruCluster Server cluster can use the NetRAIN and NIFF features in conjunction with the Tru64 UNIX Event Manager (EVM) to monitor the health of client networks.

For more information about NetRAIN and NIFF, see the Tru64 UNIX Network Administration: Connections manual, niffd(8), niff(7), and nr(7).

5.5    File System Partitioning

CFS makes all files accessible to all cluster members. Each cluster member has the same access to a file, whether the file is stored on a device that is connected to all cluster members or on a device that is private to a single member. However, CFS does allow you to mount an AdvFS file system so that it is accessible to only a single cluster member. This is called file system partitioning.

ASE offered functionality like that of file system partitioning. File system partitioning is provided in TruCluster Server Version 5.1A to ease migration from ASE. See the TruCluster Server Cluster Administration manual for information on how to mount partitioned file systems and any known restrictions.