Modify the ASE_HA.sh Script

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. You must 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 will slightly differ depending on whether the script is for the primary or secondary companion. Each node has 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 only have read, write, and execute permissions for “root.” An easy way to do this is to first modify both scripts on the same node, copy both the scripts to the other node, and then set the appropriate permissions for the scripts on both nodes.

To modify the script for your environment:

  1. Change to the $SYBASE/$SYBASE_ASE/install directory.

  2. As root, copy ASE_HA.sh to the HACMP event handler script directory, usually in /usr/sbin/cluster/events, and name it:

    RUNHA_<server_name>.sh
    

    where server_name is the Adaptive Server to be monitored.

    For example, to copy a ASE_HA.sh script for a server named MONEY1 to the /usr/sbin/cluster/events directory, enter:

    cp ASE_HA.sh /usr/sbin/cluster/events/RUNHA_MONEY1.sh
    
  3. 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:

  4. Edit the script for the primary companion. The example below shows the settings in the RUNHA_MONEY1.sh script for primary companion MONEY1 running on host FIN1, and for secondary companion PERSONEL1 running on host HUM1. In this example, when the primary companion shuts down, the monitor script tries one time to reboot the primary companion on node FIN1. If this fails, the script shuts down the HACMP services on FIN1 and moves the database devices for MONEY1 to PERSONEL1 on HUM1. If PERSONEL1 is down or in an inconsistent state, the script starts MONEY1 on HUM1

    Variable

    Primary Companion

    ASE_FAILOVER

    yes

    BASIC_FAILOVER

    yes

    RETRY

    1

    SYBASE_ASE

    ASE-12_5

    SYBASE_OCS

    OCS-12_5

    PRIM_SERVER

    MONEY1

    PRIM_HOST

    FIN1

    HA_LOGIN

    “sa”

    HA_PWD

    “Odd1Think

    PRIM_CONSOLE_LOG

    $SYBASE/$SYBASE_ASE/install/MONEY1.CS_log

    SEC_SERVER

    PERSONEL1

    SEC_HOST

    HUM1

    SEC_CONSOL_LOG

    $SYBASE/$SYBASE_ASE/install/PERSONEL.CS_log

  5. Edit the script for the secondary companion. These values will 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, 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.

    Table 8-1 describes the values for the variables for both an asymmetric setup and a symmetric setup on primary companion MONEY1 and secondary companion PERSONEL1:

    Table 8-1: Values for the secondary companion

    Variables

    Asymmetric Secondary companion

    Symmetric Secondary Companion

    RETRY

    10

    1

    ASE_FAILOVER

    no

    yes

    BASIC_FAILOVER

    no

    yes

    PRIM_SERVER

    PERSONEL1

    PERSONEL1

    PRIM_HOST

    HUM1

    HUM1

    SEC_SERVER

    PERSONEL1

    MONEY1

    SEC_HOST

    HUM1

    FIN1