The ASE_HA.sh script is used to start, stop, and monitor an Adaptive Server in a high availability environment. Adaptive Server includes this script in the $SYBASE/$SYBASE_ASE/install directory. Make a copy of this script and modify it for your environment for both Adaptive Servers running in the cluster. The modifications you make to the script depend on whether the script is for the primary or secondary companion. You must install the ASE_HA.sh script in /var/cluster/caa/script/ASE_server_name.scr.
To modify the script for your environment:
Change to the $SYBASE/$SYBASE_ASE/install directory.
As “root,” copy ASE_HA.sh to a file named /var/cluster/caa/script/server_name.scr. where server_name is the Adaptive Server to be monitored.
Edit the server_name.scr script for your environment. The original ASE_HA.sh script contains the variables listed below. Edit the lines that include “__FILL_IN__” (and any other lines that require editing) with the values for your site:
RECOVERY_TIMEOUT – the maximum amount, in seconds, of time the high availability system waits before determining that the companion did not start. Set this number high enough for a loaded companion to restart. RECOVERY_TIMEOUT is also used as the maximum amount of time the subsystem waits for the failover and failback to complete.
SHUTDOWN_TIMEOUT – the maximum time, in seconds, the high availability system waits for the companion to shut down before killing it.
This value should always be less than the amount of
time configured for the action script time_out in
the profile.
RESPONSE_TIMEOUT – the maximum amount of time the subsystem allows for a simple query to return a result set. RESPONSE_TIMEOUT used to diagnose whether or not the companion server has stopped responding. For example, if isql fails to establish a connection in 60 seconds, it automatically times out and exits. However, if isql successfully connects, but does not return a result set, RESPONSE_TIMEOUT may determine that the companion server is hung. By default, RESPONSE_TIMEOUT is set to 999999.
ASE_FAILOVER – set to:
Yes – Monitors the companion server for stopped or dead processes and relocate the TruCluster service to the secondary node.
You must also run sp_companion...configure on the server.
No – do not relocate the TruCluster subsystem on this node even if the primary companion fails over.
This setting is useful if you need to bring down a companion for maintenance or re configuration. If you are configuring an asymmetric setup, set ASE_FAILOVER to no on the secondary server.
WARNING! Set to yes only if both servers are running Adaptive Server version 12.0 or later. If either Adaptive Server is earlier than version 12.0, set ASE_FAILOVER to no.
BASIC_FAILOVER – set to:
Yes – use the failover mechanisms provided by the TruCluster subsystem if it determines the servers are running in modes that allow failover. When fail over occurs, the TruCluster subsystem monitor first checks if the companions are in a correct mode to perform fail over. If the companions are not enabled for Sybase Failover (that is, have enable ha set to 1), if they are running in single-server mode, or if the secondary companion is down, the TruCluster subsystem monitor checks whether BASIC_FAILOVER is set. If it is, the monitor attempts to start the primary companion on the secondary node.
No – do not revert to mode0 failover (mode 0 restarts the primary companion on the secondary node, and does not involve Sybase Failover) even if Sybase Failover criteria is not met. That is, if BASIC_FAILOVER is set to no, failover occurs neither at the node nor the companion level.
SYBASE – the $SYBASE environment variable.
retry – the number of times the TruCluster subsystem attempts to restart the local node before failing over. Set this to a high number for an asymmetric setup so the secondary companion is more likely to restart itself if it goes down. The default is 0, which means that the companion does not restart on the same node if it goes down.
SYBASE_ASE – the installation directory of Sybase Adaptive Server products. The default is ASE-12_0.
SYBASE_OCS – the installation directory of Sybase Open Client products. The default is OCS-12_0.
PRIM_SERVER – the name of the primary companion.
SEC_SERVER – the name of the secondary companion.
PRIM_HOST – the name of the primary host or service interface.
SEC_HOST – the name of the secondary host or service interface name.
HA_LOGIN – the login of the user with the sa_role and ha_role. This must be the same on both the primary and the secondary companion.
HA_PWD – the password for the HA_LOGIN. This has to be the same on both the primary and secondary companion.
Edit the script for the primary companion.
Edit the script for the secondary companion. These values differ depending on whether you are using an asymmetric or a symmetric setup.
If this is an asymmetric setup, the values for PRIM_SERVER should be the same as SEC_SERVER (the name of the secondary companion). PRIM_HOST should be the same as SEC_HOST.
If this is a symmetric setup, the values for the PRIM_SERVER, PRIM_HOST, SEC_SERVER, and SEC_HOST in the secondary companion script are the opposite of what is set in the primary companion script.
Register your server_name.cap file. The syntax is:
caa_register PRIM_SERVER
caa_register SEC_SERVER
Start the server_name.cap file. The syntax is:
caa_start PRIM_SERVER
caa_start SEC_SERVER
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |