Edit the ASE_HA.sh Script

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:

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

  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
    
  3. 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
    
  4. 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:

    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:

    Table 7-1: Settings for MONEY1 in the ASE_HA.sh script

    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

  5. 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
    
  6. 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
    
  7. 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:

    Table 7-2: Settings for PERSONEL1 in the ASE_HA.sh script

    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