Configuring SAPWebAS71 preonline script

In a clustered environment, the SAP administrator installs and configures the SAP standalone Enqueue and SAP Enqueue Replication server. The SAP Enqueue and Enqueue Replication Servers have the following requisites:

The SAPWebAS71 preonline script facilitates proper Enqueue server failover behavior. The existing VCS preonline script calls the SAPWebAS71 preonline script.

The SAPWebAS71 preonline script performs the following tasks:

To accomplish this failover behavior, you must configure the VCS preonline script.

To configure the VCS preonline script in the VCS 4.x and 5.0 environments

  1. Create a symlink for the preonline script to the monitor script by running the following commands.

    Note:

    You need to create this link only if the package installer has failed to create it.

    4.x

    cd /opt/VRTSvcs/bin/SAPWebAS71

    ln -s /opt/VRTSvcs/bin/SAPWebAS71/monitor preonline

    5.x

    cd /opt/VRTSagents/ha/bin/SAPWebAS71

    ln -s /opt/VRTSagents/ha/bin/SAPWebAS71/monitor preonline

  2. Navigate to the $VCS_HOME/bin/triggers directory.
  3. In the preonline file, add these lines to integrate the call to the SAPWebAS71 preonline trigger, in the main trigger script.

    If you do not find the preonline file, proceed to step 4.

    eval 'exec /opt/VRTSperl/bin/perl -Sw $0 ${1+"$@"}'
            if 0;
    use strict;
    use vars;
    my $vcs_home = $ENV{"VCS_HOME"};
    if (!defined ($vcs_home)) {
            $vcs_home="/opt/VRTSvcs";
    }
    use ag_i18n_inc;
    VCSAG_SET_ENVS();
    if (!defined $ARGV[0]) {
            VCSAG_LOG_MSG ("W", 
    "Failed to continue; undefined system name", 15028);
            exit;
    } elsif (!defined $ARGV[1]) {
            VCSAG_LOG_MSG ("W", 
    "Failed to continue; undefined group name", 15031);
            exit;
    }
    # Add the SAPWebAS71 Trigger Call here….
    #-------------------
    # Define variables..
    #-------------------
    my $sCmd = '/opt/VRTSvcs/bin/SAPWebAS71/preonline';

    For VCS 5.0, the value of $sCmd must be equal to /opt/VRTSagents/ha/bin/SAPWebAS71/preonline.

    my $sResLogLevel = 'TRACE'; # Define logging level..
    my @lsCmdArgs = ( @ARGV, $sResLogLevel ); # Insert logging level..
    my $sArgs = join ( ' ', @lsCmdArgs);
    my $iExitCode = undef;
    #------------------------------------------
    # Pass control to preonline, if it exists..
    #------------------------------------------
    if ( -x $sCmd ) {
      VCSAG_LOG_MSG ("I", "Preonline Cmd [$sCmd] 
    		Args [$sArgs]", 15031);
      system ( $sCmd, @lsCmdArgs );
    #-------------------
    # Exit if successful..
    #-----------------------------
      exit $iExitCode unless ( $iExitCode = $?>> 8 );
    }
    # give control back to HAD.
    if (defined $ARGV[3]) {
       system("$vcs_home/bin/hagrp -online -nopre $ARGV[1] -sys 
    	$ARGV[0] -checkpartial $ARGV[3]");
       exit;
    }
    system("$vcs_home/bin/hagrp -online -nopre $ARGV[1] 
    -sys $ARGV[0]");
    exit;
  4. If the VCS preonline trigger script is not present, you can do the following:

    • Pick the sample preonline script present in the following directory.

      4.x

      /etc/VRTSvcs/conf/sample_SAPWebAS71

      5.x

      /etc/VRTSagents/ha/conf/SAPWebAS71

    • Copy this file in the $VCS_HOME/bin/triggers directory.

    • Ensure that the file is executable, and accessible to the "root" user.

  5. For the service group, set the preonline flag to True.

    For 4.x and 5.0 use,

    hagrp -modify service_groupPreOnline 1

    For 5.1 use,

    hagrp -modify service_group PreOnline 1 -sys system

    The preonline script is now configured to facilitate Enqueue server behavior. To configure the logging level used in the preonline script, you can set the ResLogLevel attribute in the preonline wrapper. You can then view the logs in the VCS engine log, /var/VRTSvcs/log/engine_A.log.

    Note:

    Once the preonline trigger is configured, you may see unexpected behavior while manually switching or performing online operations on the Enqueue Replication service group. This behavior is a result of the control logic within the preonline trigger that protects the Enqueue lock table. For system maintenance, if you prefer to perform manual operations on the service groups, you can do so by disabling the preonline trigger.

    To disable the preonline trigger, use the following command:

    For VCS 4.x and 5.0,

    # hagrp -modify service_group PreOnline 0

    For VCS 5.1 use the following command on each system

    # hagrp -modify service_group PreOnline 0 -sys system