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 your site). This is a list of these lines:

    Table 7-1 shows the settings in MONEY1.sh for the primary companion MONEY1 running on host FIN1, and for the secondary companion PERSONNEL1, running on host HUM1. Both use a local file system. During failover, MONEY1 restarts on HUM1 if PERSONNEL1 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

    PERSONNEL1

    PRIM_HOSTNAME

    HUM1

    SEC_CONSOLE_LOG

    $PRIM_SYBASE/$SYBASE_ASE/install/PERSONNEL1.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. Table 7-2 shows values for PERSONNEL1.sh.

    Table 7-2: Settings for PERSONNEL1 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

    PERSONNEL1

    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/PERSONNEL1.cs_log