The ASE_HA.sh script is used to start, stop, and monitor 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 in the cluster. The modifications you make to the script depend on whether the script is for the primary or secondary companion. Each node must have a copy of this script at the same location (for example, both nodes have a copy of the script in /usr/u/sybase), and both copies must have read, write, and execute permissions for “root”. The easiest way to do this is to first modify both scripts on the same node, copy both the scripts to the other node, then set the appropriate permissions for the scripts on both nodes.
To modify the script for your environment:
Change to the $SYBASE/$SYBASE_ASE/install directory.
As “root”, copy ASE_HA.sh to the HACMP event handler script directory, usually /usr/sbin/cluster/events, and enter:
RUNHA_<server_name>.sh
where server_name is the Adaptive Server to be monitored.
Login and password of the user with the sa_role and ha_role can be a normal string or an encrypted string.
If you want to use the encrypted username and password the value of CIPHER is the encrypted string you get from the haisql utility (located in $SYBASE/$SYBASE_ASE/bin). Sybase recommends usage of “encrypted” login and password so the sensitive information in the file is well protected.
To use haisql to generate the encrypted login string:
Run haisql with no arguments to generate the encrypted string for a given login_name and password:
$SYBASE/ASE-12_5/bin/haisql Enter Username: sa Enter Password: TWAS8n1jSF2gBsvayUlw97861.cyTKaS1YhavBRQ2qKcJwtx.TmFBarGS2Kl553WDR7g8m5vrf86t@K4CU62HEccm4zkeexsP9E=FeuvX
Copy and then paste the encrypted string to the “ASE_HA.sh” script as the value for CIPHER.
If you set CIPHER then the “ASE_HA.sh” script uses the encrypted login and password. Do not set HA_LOGIN and HA_PWD if CIPHER is set.
You must edit the RUNHA_server_name.sh 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:
MONITOR_INTERVAL – the interval of time, in seconds, RUNHA_server_name.sh waits between checks to see if the data server process is alive.
RECOVERY_TIMEOUT – the maximum amount of time, in seconds, 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 amount of time 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 it takes for the HACMP wait time parameter
to go into a config_too_long state.
By default this is 360 seconds. If your server takes longer than this
to start, reconfigure this value by executing:
chssys
-s clstrmgr -a "-u milliseconds_to_wait"
RESPONSE_TIMEOUT – the maximum amount of time the subsystem allows for a simple query to return a result set is used to diagnose whether the companion server is hung. 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 has stopped responding. By default, RESPONSE_TIMEOUT is set to 999999.
ASE_FAILOVER – set to:
Yes – monitors the companion server for stopped or dead processes and stops HACMP services on this node so the devices fail over to the secondary node. You must also run sp_companion configure on the server.
No – do not bring down the HACMP subsystem on this node even if the primary companion fails over. This setting is useful if you must bring down a companion for maintenance or reconfigure.
If you are configuring an asymmetric setup, set ASE_FAILOVER to no.
WARNING! Set ASE_FAILOVER to yes only if both servers are running Adaptive Server version 12.0 or later. For versions earlier than 12.0, set ASE_FAILOVER to no.
BASIC_FAILOVER – set to:
Yes – use the failover mechanisms provided by the HACMP subsystem if it determines the servers are running in modes that allow failover. When a failover occurs, the HACMP subsystem monitor first checks if the companions are in a correct mode to perform a failover. If the companions are not enabled for Sybase Failover (that is, they have enable ha set to 1), if they are running in single-server mode, or if the secondary companion is down, the HACMP subsystem monitor checks if BASIC_FAILOVER is set. If it is, the monitor attempts to start the primary companion on the secondary node.
No – do not revert to mode 0 failover even if Sybase Failover criteria is not met. That is, if BASIC_FAILOVER is set to no, failover neither at the node nor the companion level.
retry – the number of times the HACMP subsystem attempts to restart on 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 ever 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. Change the default of ASE-12_0 to ASE-12_5.
SYBASE_OCS – the installation directory of Sybase Open Client products. The default is OCS-12_0; change this to OCS-12_5.
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 name.
SEC_HOST – the name of the secondary host or service interface.
PRIM_SYBASE – the directory to which the $SYBASE environment variable should be set on the primary host. If you are using local devices, the location must be the same on both nodes. If you are using a shared device, this location must be different on both nodes.
SEC_SYBASE – the directory to which the $SYBASE environment variable should be set on the secondary host. If you are using local devices, the location must be the same on both nodes. If you are using a shared device, this location must be different on both nodes.
PRIM_SYBASE_HOME – the path to the directory in the secondary host in which the Adaptive Server products are installed. Usually this is $SYBASE/$SYBASE_ASE.
PRIM_ISQL – the path to the isql binary on the primary host.
SEC_ISQL – the path to the isql binary on the secondary host.
CIPHER – Encrypted login and password for user with sa_role and ha_role. This has to be the same on both the primary and secondary servers. It is the encrypted string you get from the haisql utility (located in $SYBASE/$SYBASE_ASE/bin). CIPHER and HA_LOGIN/HA_PWD are mutually exclusive. If you set CIPHER then the script uses the encrypted login and password. Do not set HA_LOGIN and HA_PWD if CIPHER is set
HA_LOGIN – the login of the user with the sa_role and ha_role. This must be the same on the primary and secondary companion.
HA_PWD – the password for the HA_LOGIN. This must be the same on the primary and secondary companion.
PRIM_RUNSCRIPT – the name of the RUNSERVER file that is used to bring up the primary companion.
PRIM_CONSOLE_LOG – the full path to the error log for the current primary companion session. This can be any file that has sufficient space and is writable by “root”. The default is $SYBASE/install.
SEC_CONSOLE_LOG – the full path to the error log for the current secondary companion session. This can be any file that has sufficient space and is writable by “root”. The default is $SYBASE/install.
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 configuration.
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, and PRIM_SYBASE should be the same as SEC_SYBASE.
If this is a symmetric setup, the values for the PRIM_SERVER, PRIM_HOST, PRIM_SYBASE, SEC_SERVER, SEC_HOST, and SEC_SYBASE in the secondary companion script are the opposite of what is set in the primary companion script.
Use the installation instructions below for upgrading
from ASE version 12.5.3 ESD #3 or earlier to 12.5.3 ESD #4
or above; 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 the following changes only if you want to use the encrypted username and password of the user with the sa_role and ha_role:
Before copying the new “ASE_HA.sh” script make a backup of an existing script located in the HACMP event handler script directory, usually located in /usr/sbin/cluster/events.
As root copy “ASE_HA.sh” from $SYBASE/$SYBASE_ASE/install directory to the HACMP event handler script directory /usr/sbin/cluster/events and name it:
RUNHA_<server_name>.sh
Where server_name is the Adaptive Server to be monitored.
The login and password for the user with the sa_role and ha_role can be a normal string or an encrypted string.If you want to use the encrypted username and password the value of CIPHER is the encrypted string you acquire from the haisql utility, located in $SYBASE/$SYBASE_ASE/bin. Sybase recommends you use an encrypted login and password so the sensitive information in the file is well protected.
To use haisql to generate the encrypted login string:
Run haisql with no arguments to generate the encrypted string for a given login name and password.
Copy and paste the encrypted string to the “ASE_HA.sh” script as the value for CIPHER.
If you set CIPHER then the script uses the encrypted login and password. Do not set HA_LOGIN and HA_PWD if CIPHER is set. Copy the other required changes from the earlier “ASE_HA.sh” script to the new “ASE_HA.sh” script.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |