See the Sun Cluster high availability subsystem manuals for information about installing the high availability subsystem.
This section assumes that the high availability subsystem is already installed.
The $SYBASE/$SYBASE_ASE/install directories for both companions must include RUNSERVER files for both companions after installing Adaptive Server on the local disks.
inst_ha_script sets up the environment for Sybase Failover to run with the Sun Cluster high availability subsystem. inst_ha_scripts is located in $SYBASE/%SYBASE_ASE/install. Before you run this script, you must edit it so that:
The $SYBASE environment variable points to the correct directory.
SC_DIR, SYB_DIR, BIN_DIR, and SCSYB_DIR variables are set correctly for your site.
After you have modified inst_ha_scripts for your site, as root, run it to:
Copy the following scripts to /opt/SUNWcluster/ha/sybase:
hasybase_fmon
hasybase_fmon_start
sybase_ccd_toggles
sybase_db_restart
sybase_db_shutdown
sybase_fm_check
sybase_fm_init
sybase_fm_start
sybase_fm_stop
sybase_get_lh
sybase_get_version
sybase_shutdown
sybase_status
sybase_status_svcs
sybase_svc_abort
sybase_svc_abort_net
sybase_svc_start
sybase_svc_start_net
sybase_svc_stop
sybase_svc_stop_net
Copy the following scripts to /opt/SUNWcluster/bin
hasybase
dbms_utilities
Change the permissions for the files listed in steps 1 and 2 so the owner and group is bin, and have their permissions set to 755. For example, to change the permissions for sybase_svc_stop, move to /opt/SUNWcluster/bin and issue:
chmod 755 sybase_svc_stop chown bin sybase_svc_stop chgrp bin sybase_svc_stop
Copy the following scripts to /etc/opt/SUNWscsyb
hasybase_support
hasybase_config_V1
Change the permissions for all these files so the owner is root and group is sys, and have their permissions set to 444. For example, to change the permissions for hasybase_support, move to /opt/SUNWcluster/bin and issue:
chmod 444 hasybase_support chown root hasybase_support chgrp sys hasybase_support
This ends the tasks inst_ha_scripts performs. You must manually perform the rest of the steps in this section.
Create a file named sybtab in the /var/opt/sybase directories for both nodes. This file must be identical on both nodes. Edit sybtab to contain:
The name and release directory location of the primary and secondary companion
The name and release directories of Backup Server for the primary and secondary companion
The name of $SYBASE_ASE and $SYBASE_OCS directories
Use the following syntax for each entry:
server_name:$SYBASE path
Where server_name is the name of the Adaptive Server or Backup Server.
For example, the sybtab file for MONEY1 and PERSONEL1 would look similar to:
MONEY1:/SYBASE12_5 MONEY1_back:/SYBASE12_5 PERSONEL1:/SYBASE12_5 PERSONEL1_back:/SYBASE12_5 SYBASE_ASE:ASE-12_5 SYBASE_OCS:OCS-12_5
Run the following command to make sure the logical hosts are running on both nodes:
haget -f mastered
haget returns the name of the logical host it is mastering. For example, if this command is run on FIN1, it returns:
loghost-MONEY1
If you have installed the $SYBASE directory on a multihost disk, create the setup files for the fault monitor. Copy the following directories (with their subdirectories) and files from $SYBASE to /var/opt/sybase:
ctlib.loc
interfaces
charsets/iso_1/
locales/locales.dat
locales/us_english/
The ctlib.loc file appears in /var/opt/sybase and in /var/opt/sybase/locales/us_english/iso_1.
Register the Sybase service using the hareg command. Run hareg on only one node of the cluster. As “root,” enter:
hareg -s -r sybase -h loghost-primary_companion,loghost-secondary_companion
Where loghost-primary_companion and loghost-secondary_companion are the two logical hosts defined on the primary and secondary nodes. For example, to register the Sybase service for primary companion MONEY1 and secondary companion PERSONEL1:
hareg -s -r sybase -h loghost-MONEY1,loghost-PERSONEL1
For more information about creating logical hosts and the hareg command, see your Sun documentation.
Check the status of the Sybase service. As “root,” issue:
hareg
hareg should return:
sybase off
If the output shows that Sybase service is off, then, still as “root,” activate the Sybase service:
hareg -y sybase
hareg returns:
sybase on
Register the primary and secondary companions with the logical hosts by issuing the hasybase command on either node of the cluster:
hasybase insert server_name loghost_name 60 10 120 300 srvlogin/srvpasswd /$SYBASE/$SYBASE_ASE/install/RUNSERVER_file_name
Where:
server_name – is the name of the companion server
loghost-loghost_name – is the name of the logical host on which the companion server is registered.
60,10,120,300 – indicate the probe cycle time, connectivity probe cycle count, probe time-out, and restart delay respectively.
srvlogin/srvpasswd – is the login name and password the cluster subsystem uses to monitor and shut down the ASE server.
RUNSERVER_file_name – is the run server file for the companion server.
For example to register primary companion MONEY1 on loghost loghost-MONEY1:
hasybase insert MONEY1 loghost-MONEY1 60 10 120 300 sa/ /SYBASE120/$SYBASE_ASE/install/RUN_MONEY1
To register secondary companion PERSONEL1 on logical loghost-PERSONEL1:
hasybase insert PERSONEL1 loghost-PERSONEL1 60 10 120 300 sa/ /SYBASE120/$SYBASE_ASE/install/RUN_PERSONEL1
See your Sun documentation for more information about the hasybase command.
Issue the hasybase command to start the primary and secondary companions:
hasybase start companion_name
This will also invoke the monitors for both companion servers.
Where companion_name is the name of the companion you want to start monitoring. For example, to begin monitoring MONEY1:
hasybase start MONEY1
hasybase starts the companions automatically if they are not already running when you issue the command.
When two adaptive servers are configured as asymmetric companions, you must start the monitor for the primary companion server and set it to on, and you must stop the monitor for the secondary companion and set it to 'off'. The secondary companion server must be started with its RUN_server file, otherwise the failover from primary server to secondary server will not succeed when something goes wrong on primary server. For example, to configure MONEY1 and PERSONEL1 as asymmetric companions with MONEY1 as the primary companion:
On MONEY1, start monitoring MONEY1 (if MONEY1 is not running, it is started):
hasybase start MONEY1
On PERSONEL1, start PERSONEL1
SYBASE/$SYBASE_ASE/install/RUN_PERSONEL1 &
When two adaptive servers are configured as symmetric companions, the monitors for both companion servers should be started, otherwise the failover won't succeed. For example to configure MONEY1 and PERSONEL1 as symmetric companions, do the following:
On MONEY1, start monitoring MONEY1 (if MONEY1 is not running, it is started):
hasybase start MONEY1
On PERSONEL1, start monitoring PERSONEL1 (if PERSONEL1 is not running, it is started):
hasybase start PERSONEL1
For more information about configuring Adaptive Server for failover, see “Configure Companion Servers for Failover”.