Sun Cluster Data Service for SAP Guide for Solaris OS

Installing and Configuring SAP and Database

This section contains the procedures that you need to install and configure SAP and the database.

ProcedureHow to Install SAP and the Database

Use this procedure to install SAP and the database.

  1. Become superuser on one of the nodes in the cluster where you are installing the central instance.

  2. Install SAP binaries on a cluster file system.

    If you are installing SAP 7.0 and later versions or NW2004 SR1, use the logical host while installing the software. During configuration the SAP installer prompts you to skip all the steps that ask you to replace the physical-hostname references with logical-hostname references. These updates to file names and file contents with such references are not required, because when you install SAP 7.0 and later versions or NW2004 SR1 using the logical host, the SAP installer creates files and file contents using the logical hostname. Thus the updates are already taken care of.


    Note –

    Before you install SAP software on a cluster file system, use the scstat(1M) command to verify that the Sun Cluster software is fully operational.


    1. For all the SAP-required kernel parameter changes, edit the /etc/system file on all the cluster nodes that will run the SAP application.

      After you edit the /etc/system file, reboot each node. See the SAP document R/3 Installation on UNIX-OS Dependencies for details about kernel parameter changes.

    2. See the SAP document Installation of the SAP R/3 on UNIX for details about how to install the central instance, the database, and the application server instances.

      See How to Install and Enable an SAP Scalable Application Server for the procedure on how to install a scalable application server in a Sun Cluster environment.

Next Steps

Go to How to Enable Failover SAP Instances to Run in a Cluster or How to Install and Enable an SAP Scalable Application Server.

ProcedureHow to Install and Enable an SAP Scalable Application Server

Use this procedure to install scalable application server instances. This procedure assumes that you installed the central instance and the database. This procedure includes additional steps for SAP 6.10, SAP 6.20, SAP 6.40, SAP 7.0 and later users to ensure that Sun Cluster HA for SAP can manage and bring online SAP 6.10, SAP 6.20, SAP 6.40, SAP 7.0 and later services. SAP 6.10, SAP 6.20, SAP 6.40, SAP 7.0 and later versions create one startsap script and one stopsap script. Other SAP versions create one startsap script and one stopsap script for each service you create. This difference accounts for the additional steps for SAP 6.10, SAP 6.20, SAP 6.40, SAP 7.0 and later users.

To configure a J2EETM engine cluster with your Sun Cluster HA for SAP, first complete this procedure. Then complete the additional steps in How to Configure an SAP J2EE Engine Cluster With Your Sun Cluster HA for SAP With an Application Server.

To configure an SAP Web dispatcher with your Sun Cluster HA for SAP agent, first complete this procedure. Then complete the additional steps in How to Configure an SAP Web Dispatcher With Your Sun Cluster HA for SAP.


Tip –

The following file system layout ensures ease of use and prevents data from being overwritten.


  1. Create all SAP directories on cluster file systems.

    • Ensure that the central instance and the database can fail over.

    • Set up the lock file on the cluster file system for the central instance to prevent a multiple startup from a different node.

      For the procedure on how to set up a lock file on the central instance, see How to Set Up a Lock File for Central Instance or the Failover Application Server.

    • Ensure that all application servers can use the SAP binaries on a cluster file system.

  2. Install the central instance and the database on a cluster file system.

    See the SAP document Installation of the SAP R/3 on UNIX for details about how to install the central instance and the database.

  3. On all nodes that host the scalable application server, create a local directory for the data/log/sec/work directories and the log files for starting and stopping the application server.

    Create a local directory for each new application server.

    Example:


    # mkdir -p /usr/sap/local/SUN/D03
    

    # chown sapsidadm:sapsys /usr/sap/local/SUN/D03
    

    Caution – Caution –

    You must perform this step. If you do not perform this step, you will inadvertently install a different application server instance on a cluster file system. The two application servers will then overwrite each other.


  4. Set up a link to point to the local application server directory from a cluster file system, so that the application server, the startup log file, and the stop log file is installed on the local file system.

    Example:


    # ln -s /usr/sap/local/SAPSID/D03 /usr/sap/SAPSID/D03
    
  5. Install the application server on all nodes.

  6. If you are using SAP 6.10, SAP 6.20, or SAP 6.40, perform the following sub steps. Otherwise, go to Step 7.

    1. Become user sapsidadm.

    2. Make a copy of the startsap script and the stopsap script, and save these files in the SAPSIDadm home directory. The file names that you choose specify this instance.


      # cp /usr/sap/SAPSID/SYS/exe/run/startsap \
      $SAPSID_HOME/startsap_instance-number
      
      # cp /usr/sap/SAPSID/SYS/exe/run/stopsap \
      $SAPSID_HOME/stopsap_instance-number
      
  7. Edit the start script and the stop script so that the startup log file and the stop log file will be node specific under the home directories of users sapsidadm and orasapsid or oradbsid.

    Example:


    # vi startsap_03
    

    Before:


    LOGFILE=$R3S_LOGDIR/`basename $0.log`

    After:


    LOGFILE=$R3S_LOGDIR/`basename $0`_`uname -n`.log
  8. If you are using the MaxDB database, perform the following sub steps. Otherwise, skip to Step 9.

    1. Create a .XUSER.62 file in the SAPSIDadm home directory as described in How to Install and Configure MaxDB in Sun Cluster Data Service for MaxDB Guide for Solaris OS.


      Note –

      This user whose home directory contains the .XUSER.62 file is an internal database user who has permissions to start, stop, and query the database.


    2. Verify that the .XUSER.62 file is correctly configured by using the -d option of the R3trans command. You must be an SAPSIDadm user to perform this verification.

  9. Copy the application server (with the same SAPSID and the same instance number) on all nodes that run the scalable application server.

    The nodes that run the scalable application server are in the resource group node-zone-list, which is located in the scalable application server .

  10. Ensure that you can start and stop the application server from each node, and verify that the log files are in the correct location. For further information about updates on SAP profiles, see the SAP documentation at http://service.sap.com/ha.


    Note –

    Update the files under the SAPSIDadm home directory so that they refer to the corresponding logical hosts. This ensures that the necessary environment variables are sourced.


  11. Create the SAP logon group if you use a logon group.

Next Steps

To configure a J2EE engine cluster with your Sun Cluster HA for SAP, go to How to Configure an SAP J2EE Engine Cluster With Your Sun Cluster HA for SAP With an Application Server.

To configure an SAP Web dispatcher with your Sun Cluster HA for SAP agent, go to How to Configure an SAP Web Dispatcher With Your Sun Cluster HA for SAP.

If you are not using a J2EE engine cluster or an SAP Web dispatcher with your Sun Cluster HA for SAP, go to Configuring Your Highly Available Database.

ProcedureHow to Enable Failover SAP Instances to Run in a Cluster

During SAP installation, the SAP software creates files and shell scripts on the server on which you installed the SAP instance. These files and scripts use physical server names. To run the SAP software with Sun Cluster software, replace references to a physical server with references to a network resource (logical hostname). Use this procedure to enable SAP to run in a cluster. The previous statement does not apply to SAP 7.0 and later versions and NW2004 SR1.

To configure a J2EE engine cluster with your Sun Cluster HA for SAP with a central instance, after you complete this procedure, complete the additional steps in How to Configure an SAP J2EE Engine With Your Sun Cluster HA for SAP With Central Instance.

To configure a J2EE engine cluster with your Sun Cluster HA for SAP with an SAP Application Server, go to How to Configure an SAP J2EE Engine Cluster With Your Sun Cluster HA for SAP With an Application Server.

To configure SAP Web dispatcher with your Sun Cluster HA for SAP agent, first complete this procedure. Then complete the additional steps in How to Configure an SAP Web Dispatcher With Your Sun Cluster HA for SAP.

  1. Make backup copies of the files you will modify in Step 5 through Step 11.

  2. Log in to the node on which you installed the SAP software.

  3. Shut down the SAP instances (central instance and application server instances) and the database.

  4. If you are using SAP 6.10, SAP 6.20, or SAP 6.40, proceed to Step 5. Otherwise, go to Step 6.

  5. Make a copy of the startsap script and the stopsap script, and save these files in the SAPSIDadm home directory. The file names that you choose must specify this instance.


    # cp /usr/sap/SAPSID/SYS/exe/run/startsap  \
    $SAPSID_HOME/startsap_logical-hostname_instance-number
    # cp /usr/sap/SAPSID/SYS/exe/run/stopsap \
    $SAPSID_HOME/stopsap_logical-hostname_instance-number
    
  6. If you are using SAP 7.0 and later versions or NW2004 SR1 proceed to Step 7. Otherwise, go to Step 8.

  7. Create a wrapper script that calls the startsap and stopsap scripts and proceed to Step 9.


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

    # chmod 755 $SAPSID_HOME/startsap_instance-number
    

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

    # chmod 755 $SAPSID_HOME/stopsap_instance-number
    
  8. Become user sapsidadm, and then perform the following tasks to change references of physical server name to logical hostname.

    • In the SAPSIDadm home directory, modify all the file names that reference a physical server name.


      # su - sapsidadm
      # mkdir backup
      # cp *.* backup
      # for i in .*physical-hostname.*> do> mv $i `echo $i | sed \
      "s/_physical-hostname//"`> done
      # for i in *physical-hostname*> do> mv $i `echo $i | \
      sed "s/physical-hostname/logical host/"`> done
      
    • In the SAPSIDadm home directory, modify all the file contents, except log file contents, that reference a physical server name.

    • In the SAP profile directory, modify all the file names that reference a physical server name.

  9. As user sapsidadm, add entries for the parameter SAPLOCALHOST.

    Add this entry to the SAPSID_Service-StringSystem-Number_logical-hostname profile file under the /sapmnt/SAPSID/profile directory.

    For central instance:


    SAPLOCALHOST=ci-logical-hostname
    

    This entry enables the external application server to locate the central instance by using the network resource (logical hostname).

    For application server:


    SAPLOCALHOST=as-logical-hostname
    
  10. Become user sapsidadm, add the following entries for enq in the DEFAULT.PFL profile file under the /sapmnt/SAPSID/profile directory.

    rdisp/enqname=ci-logical-hostname_COK_00
    
  11. Become user orasapsid or oradbsid, and then perform the following tasks.


    Note –

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


    • In the oraSAPSID or oradbsid home directory, modify all the file names that reference a physical server name.

    • In the oraSAPSID or oradbsid home directory, modify all the file contents, except log file contents, that reference a physical server name.

  12. Ensure that the /usr/sap/tmp directory owned by user sapsidadm and group sapsys exists on all nodes or zones that can master the failover SAP instance. For further information about updates to SAP profiles, see the SAP documentation at http://service.sap.com/ha.

Next Steps

To configure a J2EE engine cluster with your Sun Cluster HA for SAP with a Central Instance, go to How to Configure an SAP J2EE Engine With Your Sun Cluster HA for SAP With Central Instance.

To configure a J2EE engine cluster with your Sun Cluster HA for SAP with an SAP Application Server, go to How to Configure an SAP J2EE Engine Cluster With Your Sun Cluster HA for SAP With an Application Server.

To configure an SAP Web dispatcher with your Sun Cluster HA for SAP agent, go to How to Configure an SAP Web Dispatcher With Your Sun Cluster HA for SAP.

If you are not using a J2EE engine cluster or an SAP Web dispatcher with your Sun Cluster HA for SAP agent, go to Configuring Your Highly Available Database.

ProcedureHow to Configure an SAP J2EE Engine Cluster With Your Sun Cluster HA for SAP With an Application Server

After you have completed How to Install and Enable an SAP Scalable Application Server, perform the following steps.


Note –

The SAP J2EE engine is started by the SAP dispatcher, which is under the protection of the Sun Cluster HA for SAP. If the SAP J2EE engine fails, the SAP dispatcher will restart it.


  1. Using the SAP J2EE Admintool GUI, change the ClusterHosts parameter to list the logical host for the central instance and port pair under the dispatcher/Manager/ClusterManager.


    logical-host-ci:port
  2. Configure the com.sap.instanceId property in the file j2ee-install-dir/additionalproperties.


    com.sap.instanceId = logical-host-as_SAPSID_SYSNR
    
  3. Configure the sapbasis.ashost property in the file j2ee-install-dir/server/services/security/work/R3Security.properties.


    sapbasis.ashost = logical-host-as
    
Next Steps

Go to Configuring Your Highly Available Database

ProcedureHow to Configure an SAP J2EE Engine With Your Sun Cluster HA for SAP With Central Instance

After you have completed How to Enable Failover SAP Instances to Run in a Cluster or How to Enable Failover SAP Instances to Run in a Cluster, perform the following steps.


Note –

The SAP J2EE engine is started by the SAP dispatcher which is under the protection of the Sun Cluster HA for SAP. If the SAP J2EE engine fails, the SAP dispatcher will restart it.


  1. Using the SAP J2EE Admintool GUI, change the ClusterHosts parameter to list all logical hosts for the application server and port pair under dispatcher/Manager/ClusterManager.


    as1–1h:port;as2–1h:port ...
    
  2. Configure the com.sap.instanceId property in the file j2ee-install-dir/additionalproperties.


    com.sap.instanceId = logical-host-ci_SAPSID_SYSNR
    
  3. Configure the sapbasis.ashost property in the file j2ee-install-dir/server/services/security/work/R3Security.properties.


    sapbasis.ashost = logical-host-ci
    
  4. Configure the host property in the file SDM-dir/program/config/flow.xml.


    host = logical-host-ci
    
Next Steps

Go to Configuring Your Highly Available Database.

ProcedureHow to Configure an SAP Web Dispatcher With Your Sun Cluster HA for SAP

After you have configured the SAP Web dispatcher with your Sun Cluster HA for SAP, perform the following steps.


Note –

The SAP Web dispatcher has the capability of auto restart. If the SAP Web dispatcher fails, the SAP Web dispatcher watch dog process will restart. Currently, there is no Sun Cluster agent available for the SAP Web dispatcher.


  1. Ensure that SAP Web dispatcher has an instance number different than the Central Instance and the application server instances.

    For example, SAPSYSTEM = 66 is used in the profile for the SAP Web dispatcher.

  2. Activate the Internet Communication Frame Services manually after you install the SAP Web Application Server.

    For more information, see SAP OSS note 517484.

Next Steps

Go to Configuring Your Highly Available Database.