Sun Cluster Data Service for SAP Web Application Server Guide for Solaris OS

ProcedureHow to Install and Configure the SAP Web Application Server and the SAP J2EE Engine

  1. For failover resource only: On one node of the cluster, install the SAP Web Application Server software.

    Refer to the SAP installation documentation.


    Note –

    If you are installing SAP 7.0 or NW2004 SR1, use the SAPINST_USE_HOSTNAME parameter to install the SAP application using the logical host. You can also use the High Availability install option to separate the SAP central services from the central instance automatically.


  2. For scalable resource only: On each node on which you plan to run the scalable SAP web application server component resource group.

    1. Create a local file system.

      This file system can be defined as you choose, as in the following example.


      # mkdir /usr/sap/local/SAPSID/INSTANCE_NAME
      

      # chown sapsidadm:sapsys /usr/sap/local/SAPSID/INSTANCE_NAME
      

      Note that SAPSID represents the SAP system identification and INSTANCE_NAME represents the name of the SAP web application server instance.

    2. As user sapsidadm, create symbolic links to the dialog instance.

      On each node, create a symbolic link to the local file system from the required directory path for the installation, as in the following example.


      $ ln -s  /usr/sap/local/SAPSID/INSTANCE_NAME \ 
      /usr/sap/SAPSID/INSTANCE_NAME
      
  3. For scalable resource only: On all the nodes of the cluster install the SAP Web Application Server or SAP J2EE engine.

    Install the same SAP Web Application Server or SAP J2EE engine software using the same SAPSYSTEM number separately on each node that can potentially master the corresponding resource. This requirement is applicable only if you are creating the corresponding resource to be scalable.

    Refer to the SAP installation documentation.

  4. If profiles for the SAP enqueue server and the SAP replica server have not been created during installation, create them manually.

    Refer to the SAP documentation at http://service.sap.com/ha.


    Note –

    The SAPSYSTEM parameter in the SAP enqueue server profile and in the SAP replica server profile must have the same value.


  5. Remove the startup of the SAP enqueue server from the SAP start profile.

    In the Sun Cluster environment, the SAP enqueue server resource starts the SAP enqueue server application. Therefore, if the SAP start profile contains the startup of the SAP enqueue server, remove it. Otherwise, the SAP enqueue server will be started more than once.

  6. Are you using SAP 6.4 or SAP 7.0 or NW2004 SR1?

  7. Become user sapsidadm.

    In the home directory of sapsidadm, create a wrapper script that invokes the appropriate startsap and stopsap script generated by the SAP installer with necessary parameters.


    # echo "/usr/sap/SID/SYS/exe/run/startsap r3 instance-name logical-host" \
    > $SAPSID_HOME/startsap_instance-number
    

    # chmod 755 $SAPSID_HOME/startsap_instance-number
    

    # echo "/usr/sap/SID/SYS/exe/run/stopsap r3 instance-name logical-host" \
    > $SAPSID_HOME/stopsap_instance-number
    

    # chmod 755 $SAPSID_HOME/stopsap_instance-number
    

    Proceed to Step 11

  8. Create a script to return logical hostnames for the SAP message server and the SAP web application server components.

    Create a script named loghost, which returns the logical hostnames for each instance of both the SAP message server and the SAP web application server components. The script must be located in the directory $HOME, where $HOME specifies the home directory of the SAP user. The following commands provide an example of the loghost script.


    if [ "$1" = "DVEBMGS00" ]; then
        echo loghost-1;
    fi
    if [ "$1" = "SCS01" ]; then
        echo loghost-2;
    fi
    if [ "$1" = "D02" ]; then
        echo loghost-3;
    fi

    Note –

    If the SAP web application server component is configured as a scalable resource, you will modify this script in a later section, How to Modify the Installation for a Scalable SAP Web Application Server Component.


  9. If you are using the SAP J2EE engine, modify the loghost script to return logical hostnames for the SAP J2EE engine.

    Modify the script loghost, which was created in Step 8, to return the logical hostnames for each instance of the SAP J2EE engine. The script is located in the directory $HOME, where $HOME specifies the home directory of the SAP user. The following commands provide an example of the modification of the loghost script.


    if [ "$1" = "JC00" ]; then
        echo loghost-4;
    fi
    if [ "$1" = "SCS02" ]; then
        echo loghost-5;
    fi
    if [ "$1" = "J02" ]; then
        echo loghost-6;
    fi
  10. Set the file permissions for the script so that it is executable.


    # chmod 755 $HOME/loghost
    
  11. Modify the SAP start and stop scripts as follows:


    Note –

    In the following steps you will be updating the SAP start and stop scripts. The initial set of updates pertain to all SAP instances being put under the control of Sun Cluster and the second set of updates depend on the instance being put under Sun Cluster.


    1. Create copies of the original SAP start and stop scripts, as in the following example.


      $ cp /sapmnt/SID/exe/startsap /sapmnt/SID/exe/startsap.orig
      

      $ cp /sapmnt/SID/exe/stopsap /sapmnt/SID/exe/stopsap.orig
      
    2. Ensure the uniqueness of the instance names.

      Add a sort -u command to the end of the line that begins with INSTANCE= in the SAP start and stop scripts. This command sorts all the instance names that are found and retains only the unique names.

      The original line is the following, where arg is the argument number, for example, 1 or 2.


      INSTANCE=`echo $arg | awk '/SCS[0-9][0-9]/{print $1}
      /ASCS[0-9][0-9]/{print $1} /DVEBMGS[0-9][0-9]/{print $1} 
      /JC[0-9][0-9]/{print $1} /D[0-9][0-9]/{print $1} 
      /J[0-9][0-9]/{print $1} /G[0-9][0-9]/{print $1}'`

      After you add a pipe to a sort -u command at the end, the line is the following, where arg is the argument number, for example, 1 or 2.


      INSTANCE=`echo $arg | awk '/SCS[0-9][0-9]/{print $1}
      /ASCS[0-9][0-9]/{print $1} /DVEBMGS[0-9][0-9]/{print $1} 
      /JC[0-9][0-9]/{print $1} /D[0-9][0-9]/{print $1} 
      /J[0-9][0-9]/{print $1} /G[0-9][0-9]/{print $1}' | sort -u`
    3. In order to source the user's profile and thus also source the SAP-specific environment files, add the following line as the second line of the SAP start and stop scripts.

      . $HOME/.profile


      Note –

      The preceding steps affect both SAP message server and SAP web application server.


    4. For SAP message server only — create a copy of the SAP start and stop scripts, as in the following example. This copy of the SAP start script will be used to start up the SAP message server resources.


      $ cp /sapmnt/SID/exe/startsap /sapmnt/SID/exe/startsap_msg_server
      

      $ cp /sapmnt/SID/exe/stopsap /sapmnt/SID/exe/stopsap_msg_server
      
    5. For SAP web application server only — create a copy of the SAP start and stop scripts, as in the following example. This copy of the SAP start script will be used to start up the SAP web application server resources.


      $ cp /sapmnt/SID/exe/startsap /sapmnt/SID/exe/startsap_webas_server
      

      $ cp /sapmnt/SID/exe/stopsap /sapmnt/SID/exe/stopsap_webas_server
      
    6. Update the SAP start and stop scripts to call the script that returns logical hostnames.

      You need to run the following command for SAP central services and SAP Web Application Server resources.


      Note –

      This step is not applicable for SAP 7.0 or NW2004 SR1.


      In the section for setting HOSTNAME, insert the name of the script $HOME/loghost, which you created in Step 8. This action is accomplished by replacing the line HOSTNAME='hostname' with the lines in the following example.


      < remove
      > add
      
      # Set HOSTNAME
      case `uname` in
         OS/390* | z/OS* | AIX* | BOS*)
           HOSTNAME=`hostname -s`
           ;;
         *)
      <    HOSTNAME=`hostname`
      >    if [ $# -eq 2 ]; then
      >         HOSTNAME=`$HOME/loghost $2`
      >    else
      >         HOSTNAME=`hostname`
      >    fi
           ;;
      esac
  12. If you are configuring a resource for SAP 7.0 or NW2004 SR1, add the following to the LD_LIBRARY_PATH to the end of the .profile filename in the home directory of user sapsidadm.

    /usr/sap/sapsid/SYS/exe/run:/oracle-client-dir/instantclient

  13. Remove the /net entry from /etc/auto_master to disable name service maps and to enable the SAP central services instance to failover in case of network failures.

  14. If the Process Monitor Facility (PMF) will be used with the SAP web application server component, the saposcol program must be started outside of the cluster environment on all the nodes that will run the SAP Web Application Server.

    The SUNW.sapwebas resource type represents the SAP web application server component in a Sun Cluster configuration. The extension property Webas_Use_Pmf for this resource type determines if PMF will be used with the SAP web application server component.

    If PMF is used, you must start the saposcol program outside of the cluster environment so that PMF does not stop the saposcol program when it stops the resource for the SAP web application server component.

    The saposcol program must be available to all the nodes that are running the SAP Web Application Server. Therefore, the program must be either in a global file system or in the local file system of each node.

    1. If the saposcol program is on the global file system and you want it to be on the local file systems, copy the program to the local file systems by performing the following actions on each node:

      • On the installation node, if the saposcol program was started separately, stop the saposcol program.

      • If the SAP system is running, stop the SAP system.

      • If the file system is not mounted, mount it to the installation node.

      • Copy the saposcol executable file from the installation node to a local directory on the target node.


        # cp /usr/sap/SAPSID/SYS/exe/saposcol destination-directory
        

        Note that SAPSID is the SAP system identification.

    2. Remove the startup of the saposcol program from the SAP start script of the SAP web application server component that will be configured to use PMF. This action is also mentioned in Step 11, together with other modifications to the SAP start and stop scripts.

    3. Start the saposcol program.

      • If the program is on the global file system, start the program from the global location.

      • If the program is on the local file system, start the program from the local directory on each node.

  15. Modify the file names and contents to use logical hostnames instead of physical hostnames.


    Note –

    This step is not applicable for SAP 7.0 or NW2004 SR1.


    The standard SAP Web Application Server installation uses the physical hostname of the node on which the SAP system is installed. You must modify SAP Web Application Server to use a logical hostname so that SAP Web Application Server works in a Sun Cluster environment.


    Note –

    If the SAP web application server component is configured as a scalable resource, you will make additional modifications in a later section, How to Modify the Installation for a Scalable SAP Web Application Server Component.


    1. Make sure that the names of the “.” files in the home directory of the SAP user do not contain the physical hostname.

      In the following example, the physical hostname is removed from the names of the “.” files.


      for i in .*physical-hostname.*
      		> do 
      		> mv $i  echo $i | sed "s/_physical-hostname//"  
      		> done
    2. Make sure that the names and contents of the database “.” files refer to logical hostname that is used by the database and not to physical hostnames.


      Note –

      The following substeps (c, d, and e) are not applicable for scalable SAP web application server and SAP J2EE engine instances.


    3. Change the file names and contents of the profile files to use the logical hostname corresponding to the individual component instead of physical hostnames.

      These files are located in /usr/sap/SAPSID/SYS/profile, where SAPSID is the SAP system identification.

    4. Add the following logical hostname entries to each SAPSID_INSTANCE_NAMESYSTEM_NUMBER_logical-hostname file that is located in the SAP profile directory. Note that SAPSID is the SAP system identification, INSTANCE_NAME is the SAP instance name, and SYSTEM_NUMBER is the SAP system number.

      SAPLOCALHOST=logical-hostname

      SAPLOCALHOSTFULL=logical-hostname.domain

    5. Replace the physical hostname with the logical hostname in the file /usr/sap/SAPSID/INSTANCE_NAME/igs/conf/igs.xml. Note that SAPSID is the SAP system identification and INSTANCE_NAME is the SAP instance name.

  16. Add or modify the parameter enq/serverhost in the SAP instance profile.


    Note –

    This step is not applicable for SAP 7.0 or NW2004 SR1.


    After installation, the parameter enq/serverhost in the SAP instance profile is set to the physical hostname. Modify this parameter to contain the name of the logical host on which the SAP enqueue server will be running.

  17. Make sure that the database is online and under the control of Sun Cluster.

    For information about setting up the Sun Cluster HA for MaxDB database, see Sun Cluster Data Service for MaxDB Guide for Solaris OS.

  18. If you are using the SAP J2EE engine, modify the SAP J2EE engine settings to reference the logical hostname.


    Note –

    This step is not applicable for SAP 7.0 or NW2004 SR1.


    1. Determine the location of the configuration scripts.

      • If the ABAP engine component is installed without the SAP J2EE engine component, or if the SAP J2EE engine component is installed as a standalone component, the scripts are located in the directory /usr/sap/SAPSID/JCINSTANCE_NUMBER/j2ee/configtool.

      • If The ABAP engine component is installed with the SAP J2EE engine, the scripts are located in the directory /usr/sap/SAPSID/DVEBMGSINSTANCE_NUMBER/j2ee/configtool.

    2. Run the configtool.sh script, which is located in the directory that was determined in Step a. Use this script to change all occurrences of a physical hostname to the corresponding logical hostname. This action includes setting the instance host and the JDBC URL to point to the logical host for the database.

    3. Bring online the database with the logical host for the database.

    4. Use the SAP configuration tool to modify the settings in the remaining steps of this procedure.

      To start the SAP configuration tool, you can use the script offlinecfgeditor.sh, which is located in the directory that was determined in Step a.

    5. In the LockingManager section, modify enqu.host to refer to the logical hostname for the SAP enqueue server. Change this entry under all the settings (the general and the instance-specific).

    6. In the LockingManager section, modify all occurrences of enq.profile.filename to use the logical hostname. Change this entry under all the settings (the general and the instance-specific).

      For example, change SAPSID_JCINSTANCE_NUMBER_physicalhost to SAPSID_JCINSTANCE_NUMBER_logicalhost. The new file name should be the same as the file name in the file /sapmnt/SAPSID/profile.

    7. In the ClusterManager section, change instance.ms.host to refer to the logical hostname for the SAP message server. Change this entry under all the settings (the general and the instance-specific).

    8. Modify the instance.properties.IDxxxxxx to refer to the logical host.

      For each instance.properties.IDxxxxxx, modify all occurrences of a physical hostname to the corresponding logical hostname.

    9. Ensure that the enqu.port parameter and the URL in the dbpool parameter have the correct settings.


    Note –

    For information about updates to SAP profiles, see the SAP documentation at http://service.sap.com/ha.