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 differ slightly depending 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:

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

  2. 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.

    For example, to copy a ASE_HA.sh script for a server named MONEY1:

    cp ASE_HA.sh /var/cluster/caa/script/MONEY1.scr
    
  3. You must 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:

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

    Variable

    Primary Companion

    ASE_FAILOVER

    yes

    BASIC_FAILOVER

    yes

    RETRY

    1

    PRIM_SERVER

    MONEY1

    PRIM_HOST

    FIN1

    HA_LOGIN

    “sa”

    HA_PWD

    “Odd1Think

    SEC_SERVER

    PERSONNEL1

    SEC_HOST

    HUM1

  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.

    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.

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

    Table 9-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

    PERSONNEL1

    PERSONNEL1

    PRIM_HOST

    HUM1

    HUM1

    SEC_SERVER

    PERSONNEL1

    MONEY1

    SEC_HOST

    HUM1

    FIN1

  6. Register your server_name.cap file. The syntax is

    caa_register PRIM_SERVER
    

    and

    caa_register SEC_SERVER
    
  7. Start the server_name.cap file. The syntax is:

    caa_start PRIM_SERVER
    

    and

    caa_start SEC_SERVER