The ASE_HA.sh template script configures the high availability subsystem to start, stop, and monitor Adaptive Server for failover. The ASE_HA.sh template script is included in the $SYBASE/$SYBASE_ASE/install directory. Make a copy of this script in the package subdirectory you created in step 1, above, and modify it to include the environment variables for your cluster environment. Both the primary and secondary companions require a copy of this script. As root, perform the following steps:
If you are currently using a script to configure Adaptive Server applications to run in your high availability system, make a backup copy of this file. For example, if you have a script named SYBASE1.sh, copy it to SYBASE1.sh.backup. Otherwise proceed to step 2
On the primary node, change to the package subdirectory under /etc/cmcluster. For example, if you are configuring the primary companion MONEY1:
cd /etc/cmcluster/MONEY1
Copy the ASE_HA.sh template script from the $SYBASE/$SYBASE_ASE/install directory to the primary companion’s package subdirectory. Use the following syntax for the package template name:
<package_name>.sh
Where package_name is the name of the companion server you are configuring. For example, to make a copy of the ASE_HA.sh file for MONEY1:
cp ASE_HA.sh /etc/cmcluster/MONEY1/MONEY1.sh
Edit the server_name.sh file for your environment. Edit the lines that include “__FILL_IN__” (and any other lines that require editing for you site). This is a list of these lines:
Where:
ASE_12_0 – specifies the version of Adaptive Server. Set this to: – “yes” if both servers are using Sybase Adaptive Server version 12.0 or greater, – “no” if you are using earlier versions of Adaptive Server.
ASE_HAFAILOVER – specifies whether you are using Sybase Failover. Set this to: – “yes” if you are using Sybase Failover, – “no” if you are using mode 0 failover
BASIC_FAILOVER – is set to either “yes” or “no:”“
yes” - Use the failover mechanisms provided by the HP MC/ServiceGuard high availability subsystem if it determines the servers are running in modes that allow failover. When a failover occurs, the script first checks if the companions are in a correct mode to perform a failover. If the companions are not enabled for Sybase’s Failover (that is, they are running in single-server mode), the script attempts to start up the primary companion on the secondary node.
“no” - Do not revert to mode 0 failover. That is, if BASIC_FAILOVER is set to no, failover does not happen at either the node or the companion level.
PACKAGE_NAME - the name of the package as specified in the MC/ServiceGuard package configuration script.
You must specify the value of the PACKAGE_NAME to be the same as the companion name. For example, if the PRIM_SERVER value is MONEY1, the value of the PACKAGE_NAME must be MONEY1 as well.
MONITOR_INTERVAL – The amount of time – in seconds – this scripts waits between checks to see if the Adaptive Server process is alive.
SHUTDOWN_TIMEOUT - The maximum amount of time – in seconds – to wait for a companion server abort to complete before killing the SYBASE Adaptive Server process. The SHUTDOWN_TIMEOUT protects a hung companion server that prevents the halt script from completing. The value of SHUTDOWN_TIMEOUT must be less than the time out variable set in the package configuration file
RECOVERY_TIMEOUT – is the maximum amount of time the high availability subsystem waits, in seconds, before determining the companion failed to start. Make sure you set this number that is sufficiently long enough for a loaded companion to reboot. RECOVERY_TIMEOUT is also used as the maximum amount of time the subsystem waits for failover and failback to complete.
SYBASE - The location in which the Sybase products are installed. This value is automatically set to PRIM_SYBASE if you are on primary host and to SEC_SYBASE if you are on the secondary host
SYBASE_ASE – is the installation directory of Sybase Adaptive Server products. The default is ASE-12_0, change it to ASE-12_5.
The original lines are:
export SYBASE_ASE = ASE-12_0 export SYBASE_OCS = ASE-12_0
You must change these lines to:
export SYBASE_ASE = ASE-12_5 export SYBASE_OCS = ASE-12_5
SYBASE_OCS – is the installation directed of Sybase Open Client products. The default is OCS-12_0, change it to ASE-12_5.
SYBUSER - The name of the user who starts the Adaptive Server session
HALOGIN – is the login of the user with the sa_role and ha_role. This has to be the same on both the primary and secondary companion.
HAPWD – is the password for the HA_LOGIN. This has to be the same on both the primary and secondary companion.
The HA_LOGIN and HA_PWD must be the same name and password used when you are configuring Adaptive Server as a companion server. (that is, running sp_companion.
PRIM_SYBASE – is the path to the directory in the primary node in which the Adaptive Server products are installed. 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_ASE_HOME - The path to the directory in which the Adaptive Server products are installed on the primary node. The default is $SYBASE/$SYBASE_ASE
PRIM_SERVER – is the name of the primary companion.
PRIM_HOSTNAME – is the name of the primary node.
PRIM_CONSOLE_LOG – is 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 SYBUSER. The default is $SYBASE/$SYBASE_ASE/install/server_name.cs_log
PRIM_RUNSCRIPT – is the name of the RUNSERVER file that is used to bring up the primary companion. The default is $SYBASE/$SYBASE_ASE/install/RUN_server_name
SEC_SYBASE – is the directory in which the Adaptive Server products are installed on the secondary node. 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_ASE_HOME - The path to the directory in which the Adaptive Server products are installed on the secondary node. The default is $SYBASE/$SYBASE_ASE
SEC_SERVER – is the name of the secondary companion.
SEC_HOSTNAME – is the name of the secondary node.
SEC_CONSOLE_LOG – is 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 SYBUSER. The default is $SYBASE/$SYBASE_ASE/install/server_name.cs_log
ISQL – is the path to the isql binary. The default is $SYBASE/$SYBASE_OCS/bin/isql
The example below shows the settings in MONEY1.sh for the primary companion MONEY1 running on host FIN1, and for the secondary companion PERSONEL1, running on host HUM1. Both of these use a local file system. During failover, MONEY1 restarts on the HUM1 if PERSONEL1 is down or not in companion mode:
Variable |
Setting |
---|---|
ASE_12_0 or higher |
yes |
ASE_HAFAILOVER |
yes |
BASIC_FAILOVER |
yes |
PACKAGE_NAME |
MONEY1 |
MONITOR_INTERVAL |
5 |
SHUTDOWN_TIMEOUT |
60 |
RECOVERY_TIMEOUT |
300 |
SYBASE_ASE |
ASE-12_5 |
SYBASE_OCS |
OCS-12_5 |
HALOGIN |
“SA” |
HAPASSWD |
“Odd2Think |
PRIM_SYBASE |
/opt/sybase |
PRIM_SERVER |
MONEY1 |
PRIM_HOSTNAME |
FIN1 |
PRIM_CONSOLE_LOG |
$PRIM_SYBASE/$SYBASE_ASE/install/MONEY1.cs_log |
SEC_SYBASE |
/opt/sybase |
SEC_SERVER |
PERSONEL1 |
PRIM_HOSTNAME |
HUM1 |
SEC_CONSOLE_LOG |
$PRIM_SYBASE/$SYBASE_ASE/install/PERSONEL1.cs_log |
Change the permission on the file to 700 so it is only readable, writable, and executable by root. For example, to change permissions for MONEY1.sh:
chmod 700 MONEY1.sh
Distribute the script to the secondary node. For example, to distribute the file to the secondary node HUM1:
rcp /etc/cmcluster/MONEY1/MONEY1.sh HUM1:/etc/cmcluster/MONEY1/MONEY1.sh
Repeat the above steps for the secondary companion.
The secondary companion package script uses values for PRIM_SERVER, PRIM_HOST, PRIM_SYBASE, SEC_SERVER, SEC_HOST, and SEC_SYBASE that are the opposite of the primary companion package script. Below are the values for PERSONEL1.sh:
Variable |
Setting |
---|---|
ASE_12_0 or higher |
yes |
ASE_HAFAILOVER |
yes |
BASIC_FAILOVER |
yes |
PACKAGE_NAME |
MONEY1 |
MONITOR_INTERVAL |
5 |
SHUTDOWN_TIMEOUT |
60 |
RECOVERY_TIMEOUT |
300 |
SYBASE_ASE |
ASE-12_5 |
SYBASE_OCS |
OCS-12_5 |
HALOGIN |
“SA” |
HAPASSWD |
“Odd2Think |
PRIM_SYBASE |
/opt/sybase |
PRIM_SERVER |
PERSONEL1 |
PRIM_HOSTNAME |
HUM1 |
PRIM_CONSOLE_LOG |
$PRIM_SYBASE/$SYBASE_ASE/install/MONEY1.cs_log |
SEC_SYBASE |
/opt/sybase |
SEC_SERVER |
MONEY1 |
PRIM_HOSTNAME |
FIN1 |
SEC_CONSOLE_LOG |
$PRIM_SYBASE/$SYBASE_ASE/install/PERSONEL1.cs_log |