Sun Cluster 3.0 U1 Data Services Installation and Configuration Guide

Chapter 9 Installing and Configuring Sun Cluster HA for SAP

This chapter provides instructions on how to plan, set up, and configure the Sun Cluster HA for SAP data service on your Sun Cluster nodes.

This chapter includes the following procedures.

Installing and Configuring Sun Cluster HA for SAP

The following table lists the sections that describe the installation and configuration tasks.

Table 9-1 Task Map: Installing and Configuring Sun Cluster HA for SAP

Task 

For Instructions, Go To 

Plan the SAP installation 

"Sun Cluster HA for SAP Overview"

"Configuration Guidelines for Sun Cluster HA for SAP"

"Sample Configurations"

"Pre-Installation Considerations"

Install and configure SAP and the database 

"How to Install SAP and the Database"

"How to Enable SAP to Run in the Cluster"

"How to Verify SAP and Database Installation With Central Instance" "How to Verify SAP and Database Installation With Application Server"

Configure the Sun Cluster HA for DBMS 

"Configuring Sun Cluster HA for DBMS"

Configure the Sun Cluster HA for SAP data service 

"How to Register and Configure Sun Cluster HA for SAP With Central Instance"

"How to Register and Configure Sun Cluster HA for SAP With Application Server"

"How to Verify the Sun Cluster HA for SAP Installation With Central Instance"

"How to Verify the Sun Cluster HA for SAP Installation With Application Server"

Configure SAP extension properties 

"Configuring SAP Extension Properties"

View Sun Cluster HA for SAP fault-monitor information 

"Sun Cluster HA for SAP Fault Monitor"

Sun Cluster HA for SAP Overview

The Sun Cluster HA for SAP data service provides fault monitoring and an automatic failover mechanism for the SAP application to eliminate single points of failure in an SAP system. The following table lists the data services that best protect SAP components in a Sun Cluster configuration.

Table 9-2 Protection of SAP Components

SAP Component 

Protected by 

SAP database 

Sun Cluster HA for Oracle, if the database is Oracle 

SAP central instance 

Sun Cluster HA for SAP, the resource type is SUNW.sap_ci

SAP application server 

Sun Cluster HA for SAP, the resource type is SUNW.sap_as

NFS file system 

Sun Cluster HA for NFS 

Use the scinstall(1M) command to install the Sun Cluster HA for SAP data service. The Sun Cluster HA for SAP data service requires a functioning cluster with the initial cluster framework already installed. See the Sun Cluster 3.0 U1 Installation Guide for details about initial installation of clusters and data services. Register the Sun Cluster HA for SAP data service after you successfully install the basic components of the Sun Cluster and SAP software.

Configuration Guidelines for Sun Cluster HA for SAP

When you design a Sun Cluster HA for SAP configuration, consider the following guidelines.

Sample Configurations

See your Enterprise Services representative for the most current information about supported SAP versions. The following figures illustrate sample configurations for the Sun Cluster HA for SAP data service.

Figure 9-1 Four-Node Cluster With Central Instance, Application Servers, and Database

Graphic

Figure 9-2 Two-Node Cluster With Central Instance, NFS, and Non-HA External Application Servers

Graphic


Note -

This figure was a common configuration under previous Sun Cluster releases. To use the Sun Cluster 3.0 software to the full extent, follow Figure 9-1 or Figure 9-3.


Figure 9-3 Two-Node Cluster With Central Instance and Development Node

Graphic

Pre-Installation Considerations

Before installing the SAP software, see "Installing and Configuring SAP and the Database", and consider the following cluster-related issues.

Installing and Configuring SAP and the Database

Use the procedures in this section to perform the following tasks.

How to Install SAP and the Database

This section describes how to install and configure SAP and the database and how to enable SAP to run in the cluster.

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

  2. Install SAP binaries on the cluster file system.


    Note -

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


    1. For all SAP-required kernel parameter changes, edit the /etc/system file on all 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 on kernel parameter changes.

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

Where to Go From Here

After you install SAP and the database, go to "How to Enable SAP to Run in the Cluster".

How to Enable SAP to Run in the Cluster

During SAP installation, the SAP software creates files and shell scripts on the server on which you installed the SAP central 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 logical hostname. Throughout these steps, the replaceable term physicalserver represents a physical server, and the replaceable term logical-hostname represents a logical hostname. The phrase logical hostname denotes the logical hostname where traffic between the database and the application server occurs. See the Sun Cluster 3.0 U1 Concepts for more information on logical hostnames.

Perform the following steps to enable SAP to run in the cluster.


Note -

Make backup copies of the files that you will modify in the following steps.


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

  2. Shut down the SAP central instance and the database.


    Note -

    In addition to the central instance and database, shut down any application servers that are running.


  3. Modify all file names that include a physical-server name in the following directories.

    • The sapsidadm home directory - Become the sapsidadm user before you edit these files.

    • The orasapsid home directory - Become the orasapsid user before you edit these files.

    • SAP profile directory - Become the sapsidadm user before you edit these files.

    For example, rename the .sapenv_physicalserver.csh file as .sapenv_logical-hostname.csh.

  4. Modify all file contents-except log file contents-that reference a physical-server name in the following directories.

    • The sapsidadm home directory - Become the sapsidadm user before you edit these files.

    • The orasapsid home directory - Become the orasapsid user before you edit these files.

    • SAP profile directory - Become the sapsidadm user before you edit these files.

    For example, change any physicalserver reference in the startup and shutdown scripts to a logical-hostname reference.

  5. As user sapsidadm, add an entry such as the following example for the parameter SAPLOCALHOST.


    SAPLOCALHOST logical-hostname
    

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

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

Where to Go From Here

After you enable SAP to run in the cluster, go to "How to Verify SAP and Database Installation With Central Instance".

How to Verify SAP and Database Installation With Central Instance

Perform this procedure to test starting and stopping the SAP central instance on all potential nodes on which the central instance can run.

  1. Create the failover resource group to hold the network logical-hostname and central-instance resources.


    # scrgadm -a -g sap-ci-resource-group
    

    Note -

    You can optionally select the set of nodes on which the SAP central instance can run with the -h option to the scrgadm(1M) command.


    # scrgadm -a -g sap-ci-resource-group -h nodelist
    


  2. Verify that you have added all the logical hostnames that you use to your name-service database.

  3. Run the scrgadm command to add a logical hostname to the failover resource group.


    # scrgadm -a -L -g sap-ci-resource-group -l logical-hostname -n nafo0@node1,nafo0@node2
    
  4. Enable the resource group.

    Run the scswitch(1M) command to move the resource group into a managed state and bring the resource group online.


    # scswitch -Z -g sap-ci-resource-group
    
  5. Log in to the cluster member that hosts the central-instance resource group.

  6. Start the central instance and the database.

  7. Start the SAP GUI to verify that SAP initializes correctly.

    The default dispatcher port is 3200.

  8. Stop the central instance and the database.

  9. Run the scswitch command.

    In the following example, the replaceable term sap-ci-resource-group represents the resource group that contains the logical-hostname resource for the central-instance resource. Switch this resource group to another cluster member that can host the central instance.


    # scswitch -z -h node -g sap-ci-resource-group
    
  10. Repeat Step 5 through Step 7 until you verify startup and shutdown of the central instance on each cluster node that can host the central instance.

Where to Go From Here

After you verify SAP and database installation with central instance, go to "How to Verify the Sun Cluster HA for SAP Installation With Application Server".

How to Verify SAP and Database Installation With Application Server

If you have installed and configured any application servers, perform this procedure on all potential nodes on which the application server can run. This procedure tests starting and stopping the application server.

  1. Create the failover resource group to hold the network logical-hostname and application-server resources.


    # scrgadm -a -g sap-as-resource-group
    

    Note -

    You can optionally select the set of nodes on which the SAP application server can run with the -h option to the scrgadm command.


    # scrgadm -a -g sap-as-resource-group -h nodelist -n nafo0@node1,nafo0@node2
    


  2. Verify that you have added all the logical hostnames that you use to your name-service database.

  3. Run the scrgadm command to add a logical hostname to the failover resource group.


    # scrgadm -a -L -g sap-as-resource-group -l logical-hostname
    
  4. Enable the resource group.

    Run the scswitch(1M) command to move the resource group into a managed state and bring the resource group online.


    # scswitch -Z -g sap-as-resource-group
    
  5. Log in to the cluster member that hosts the application-server resource group.

  6. Start the application server.

  7. Start the SAP GUI to verify that the SAP application server initializes correctly.

  8. Stop the application server.

  9. Run the scswitch command.

    In the following example, the term sap-as-resource-group represents the resource group that contains the logical-hostname resource for the application-server resource. Switch this resource group to another cluster member that can host the application server.


    # scswitch -z -h node -g sap-as-resource-group
    
  10. Repeat Step 5 through Step 7 until you verify startup and shutdown of the application server on each cluster node that can host the application server.

Where to Go From Here

After you finish all procedures to install and configure SAP and the database, go to "How to Register and Configure Sun Cluster HA for SAP With Central Instance".

Configuring Sun Cluster HA for DBMS

SAP supports various databases. See the appropriate chapter of this book for details on how to configure the resource type, resource group, and resource for your highly available database. For example, see "Installing and Configuring Sun Cluster HA for Oracle" for more information if you plan to use Oracle with SAP.

Additionally, see the appropriate chapter of this book and the appropriate chapter of your database installation book for details on other resource types to configure with your database. This book includes details on how to configure other resource types for Oracle databases. For instance, set up the resource type SUNW.HAStorage if you use Oracle. See the procedure "How to Configure SUNW.HAStorage Resource Type" for more information.

Registering and Configuring Sun Cluster HA for SAP

Use the procedures in this section to perform the following tasks.

How to Register and Configure Sun Cluster HA for SAP With Central Instance

To register and configure the Sun Cluster HA for SAP data service with a central instance, perform the following steps.

  1. Become superuser on one of the nodes in the cluster that hosts the central instance.

  2. Register the resource type for the SAP data service.

    For central instance, run the scrgadm command to register the resource type SUNW.sap_ci.


    # scrgadm -a -t SUNW.sap_ci
    
  3. Run the scrgadm command to create SAP application resources in this failover resource group.


    # scrgadm -a -j sap-ci-resource -g sap-ci-resource-group -t SUNW.sap_ci 
    
    -x SAPSID=SAPSID 
    
    -x Ci_startup_script=ci-startup-script 
    
    -x Ci_shutdown_script=ci-shutdown-script
    
  4. Run the scswitch command to enable the resource group that now includes the SAP central-instance resource.


    # scswitch -Z -g sap-ci-resource-group
    

Where to Go From Here

After you register and configure Sun Cluster HA for SAP with central instance, go to "How to Register and Configure Sun Cluster HA for SAP With Application Server".

How to Register and Configure Sun Cluster HA for SAP With Application Server

To register and configure the Sun Cluster HA for SAP data service with an application server, perform the following steps.

  1. Become superuser on one of the nodes in the cluster that hosts the application server.

  2. Register the resource type for the SAP data server.

    For application server, run the scrgadm command to register the resource type SUNW.sap_as.


    # scrgadm -a -t SUNW.sap_as
    
  3. Run the scrgadm command to create SAP application server resources in this failover resource group.


    # scrgadm -a -j sap-as-resource -g sap-as-resource-group -t SUNW.sap_as 
    
    -x SAPSID=SAPSID 
    
    -x As_instance_id=as-instance-id 
    
    -x As_startup_script=as-startup-script 
    
    -x As_shutdown_script=as-shutdown-script
    
  4. Run the scswitch command to enable the resource group that now includes the SAP application-server resource.


    # scswitch -Z -g sap-as-resource-group
    

Where to Go From Here

After you register and configure Sun Cluster HA for SAP with application server, go to "How to Verify the Sun Cluster HA for SAP Installation With Central Instance".

How to Verify the Sun Cluster HA for SAP Installation With Central Instance

Perform the following steps to verify both the Sun Cluster HA for SAP installation with a central instance and the Sun Cluster HA for DBMS installation and configuration.

  1. Log in to the node that hosts the resource group that contains the SAP central-instance resource.

  2. Become user sapsidadm.

  3. Start the SAP GUI to check that the Sun Cluster HA for SAP data service is functioning correctly.

  4. Use the central-instance stopsap script to shut down the SAP central instance.

    The Sun Cluster software should restart the central instance because the Sun Cluster software controls the SAP software.

  5. Run the scswitch command to switch the SAP resource group to another cluster member.


    # scswitch -z -h node2 -g sap-ci-resource-group
    
  6. Verify that the SAP central instance starts on this node.

  7. Repeat Step 1 through Step 6 until you have tested all potential nodes on which the SAP central instance can run.

Where to Go From Here

After you verify the Sun Cluster HA for SAP installation with central instance, go to "How to Verify the Sun Cluster HA for SAP Installation With Application Server".

How to Verify the Sun Cluster HA for SAP Installation With Application Server

If you have installed and configured any SAP application servers, perform the following steps to verify the Sun Cluster HA for SAP installation and configuration with application servers.

  1. Log in to the node that currently hosts the resource group that contains the SAP application-server resource.

  2. Become user sapsidadm.

  3. Start the SAP GUI to check that the Sun Cluster HA for SAP data service is functioning correctly.

  4. Use the application-server stopsap script to shut down the SAP application server.

    The Sun Cluster software should restart the application server because the Sun Cluster software controls the SAP software.

  5. Run the scswitch command to switch the resource group that contains the SAP application-server resource to another cluster member.


    # scswitch -z -h node2 -g sap-as-resource-group
    
  6. Verify that the SAP application server starts on this node.

  7. Repeat Step 1 through Step 6 until you have tested all potential nodes on which the SAP application server can run.

Configuring SAP Extension Properties

This section describes how to configure Sun Cluster HA for SAP extension properties for the central instance and application servers. Typically, you use the command line scrgadm -x parameter=value to configure the extension properties when you create the central-instance or application resource. You can also use the procedures described in Chapter 11, Administering Data-Service Resources to configure them later.

See the r_properties(5) and the rg_properties(5) man pages for details on all Sun Cluster extension properties.

Table 9-3 describes SAP extension properties you can set for the central instance. You can update some extension properties dynamically. You can update others, however, only when you create or disable the SAP resource. The Tunable column in the following table indicates when you can update each property.

Table 9-3 Sun Cluster HA for SAP Extension Properties for Central Instance

Property Category 

Property Name 

Default 

Tunable 

Description 

SAP Configuration 

 

 

SAPSID

None 

When disabled 

SAP system name or SAPSID.

Ci_instance_id

00

When disabled 

Two-digit SAP system number. 

Ci_services_string

DVEBMGS

When disabled 

String of central-instance services. 

Starting SAP 

 

Ci_start_retry_ interval

30

When disabled 

The interval in seconds to wait between attempting to connect to the database before starting the central instance. 

Ci_startup_script

None 

When disabled 

Name of the SAP startup script for this instance in your SIDadm home directory.

Stopping SAP 

 

Stop_sap_pct

95

When disabled 

Percentage of stop-timeout variables that are used to stop SAP processes. The SAP shutdown script is used to stop processes before calling Process Monitor Facility (PMF) to terminate and then kill the processes. 

Ci_shutdown_script

None 

When disabled 

Name of the SAP shutdown script for this instance in your SIDadm home directory.

Probe 

Message_server_name

sapmsSAPSID

When disabled 

The name of the SAP message server. 

Lgtst_ms_with_ logicalhostname

TRUE

Any time 

How to check the SAP message server with the SAP lgtst utility. The lgtst utility requires a hostname (IP address) as the location for the SAP message server. This hostname can be either a Sun Cluster logical hostname or a localhost (loopback) name. If you set this resource property to TRUE, use a logical hostname. Otherwise, use a localhost name.

Check_ms_retry

2

When disabled 

Maximum number of times the SAP message server check fails before a total failure is reported and the Resource Group Manager (RGM) starts. 

Probe_timeout

60

Any time 

Time-out value in seconds for the probes. 

Monitor_retry_count

4

Any time 

Number of PMF restarts that are allowed for the fault monitor. 

Monitor_retry_ interval

2

Any time 

Time interval in minutes for fault-monitor restarts. 

Development System 

 

 

 

Shutdown_dev

FALSE

When disabled 

Whether the RGM should shut down the development system before starting up the central instance. 

Dev_sapsid

None 

When disabled 

SAP System Name for the development system (if you set Shutdown_dev to TRUE, the Sun Cluster HA for SAP data service requires this property).

Dev_shutdown_script

None 

When disabled 

Script that is used to shut down the development system. If you set Shutdown_dev to TRUE, the Sun Cluster HA for SAP data service requires this property.

Dev_stop_pct

20

When disabled 

Percentage of startup timeouts the Sun Cluster HA for SAP data service uses to shut down the development system before starting the central instance. 

The following table describes extension properties you can set for SAP with application servers.

Table 9-4 Sun Cluster HA for SAP Extension Properties for Application Server

Property Category 

Property Name 

Default 

Tunable 

Description 

SAP Configuration 

 

 

SAPSID

None 

When disabled 

SAP system name or SAPSID for the application server.

As_instance_id

None 

When disabled 

Two-digit SAP system number for the application server. 

As_services_string

D

When disabled 

String of application-server services. 

Starting SAP 

 

 

As_db_retry_interval

30

When disabled 

The interval in seconds to wait between attempting to connect to the database and starting the application server. 

As_startup_script

None 

When disabled 

Name of the SAP startup script for the application server. 

Stopping SAP 

 

 

Stop_sap_pct

95

When disabled 

Percentage of stop-timeout variables that are used to stop SAP processes. The SAP shutdown script is used to stop processes before calling Process Monitor Facility (PMF) to terminate and then kill the processes. 

As_shutdown_script

None 

When disabled 

Name of the SAP shutdown script for the application server. 

Probe 

Probe_timeout

60

Any time 

Time-out value in seconds for the probes. 

Monitor_retry_count

4

Any time 

Number of PMF restarts that the probe allows for the fault monitor.  

Monitor_retry_ interval

2

Any time 

Time interval in minutes for fault-monitor restarts. 

Sun Cluster HA for SAP Fault Monitor

The Sun Cluster HA for SAP fault monitor checks SAP process and database health. SAP process health impacts SAP resources' failure history. SAP resources' failure history in turn drives the fault monitor's actions, which include no action, restart, or failover.

In contrast to SAP process health, the health of the database SAP uses has no impact on SAP resources' failure history. Database health does, however, trigger the SAP fault monitor to log any syslog messages and to set the status accordingly for the SAP resource that uses the database.

Sun Cluster HA for SAP Fault Probes for Central Instance

For the central instance, the fault probe executes the following steps.

  1. Retrieves the process IDs for the Message Server and the dispatcher.

  2. Loops infinitely (sleeps for Thorough_probe_interval).

  3. Checks the health of the SAP resources.

    1. Abnormal exit - If the PMF detects that the SAP process tree has failed, the fault monitor treats this problem as a complete failure. The fault monitor restarts or fails over the SAP resource to another node based on the resources' failure history.

    2. Health check of the SAP resources through probe - The probe uses the ps(1) command to check the SAP Message Server and main dispatcher processes. If any of the SAP Message Server or main dispatcher processes are missing from the system's active processes list, the fault monitor treats this problem as a complete failure.

      If you configure the parameter Check_ms_retry to have a value greater than zero, the probe checks the Message Server connection. If you have set the extension property Lgtst_ms_with_logicalhostname to its default value TRUE, the probe completes the Message Server connection test with the utility lgtst. The probe uses the logical hostname interface specified in the SAP resource group to call the SAP-supplied utility lgtst. If you set the extension property Lgtst_ms_with_logicalhostname to a value other than TRUE, the probe calls lgtst with the node's localhost name (loopback interface).

      If the lgtst utility call fails, the SAP Message Server connection is not functioning. In this situation, the fault monitor considers the problem to be a partial failure and does not trigger an SAP restart or a failover immediately. The fault monitor counts two partial failures as a complete failure if the following conditions occur.

      1. You configure the extension property Check_ms_retry to be 2.

      2. The fault monitor accumulates two partial failures that happen within the retry interval that the resource property Retry_interval sets.

      A complete failure triggers either a local restart or a failover, based on the resource's failure history.

    3. Database connection status through probe - The probe calls the SAP-supplied utility R3trans to check the status of the database connection. Sun Cluster HA for SAP fault probes verify that SAP can connect to the database. Sun Cluster HA for SAP depends, however, on the highly available database fault probes to determine the health of the database. If the database connection status check fails, the fault monitor logs the message "Database might be down" to syslog. The fault monitor then sets the status of the SAP resource to DEGRADED. If the probe checks the status of the database again and the connection is reestablished, the fault monitor logs the message "Database is up" to syslog and sets the status of the SAP resource to OK.

  4. Evaluates the failure history.

    Based on the failure history, the fault monitor completes one of the following actions.

    • No action

    • Local restart

    • Failover

Sun Cluster HA for SAP Fault Probes for Application Server

For the application server, the fault probe executes the following steps.

  1. Retrieves the process ID for the main dispatcher.

  2. Loops infinitely (sleeps for Thorough_probe_interval).

  3. Checks the health of the SAP resources.

    1. Abnormal exit - If the PMF detects that the SAP process tree has failed, the fault monitor treats this problem as a complete failure. The fault monitor restarts or fails over the SAP resource to another node, based on the resources' failure history.

    2. Health check of the SAP resources through probe - The probe uses the ps(1) command to check the SAP Message Server and main dispatcher processes. If the SAP main dispatcher process is missing from the system's active processes list, the fault monitor treats the problem as a complete failure.

    3. Database connection status through probe - The probe calls the SAP-supplied utility R3trans to check the status of the database connection. Sun Cluster HA for SAP fault probes verify that SAP can connect to the database. Sun Cluster HA for SAP depends, however, on the highly available database fault probes to determine the health of the database. If the database connection status check fails, the fault monitor logs the message "Database might be down" to syslog and sets the status of the SAP resource to DEGRADED. If the probe checks the status of the database again and the connection is reestablished, the fault monitor logs the message "Database is up" to syslog. The fault monitor then sets the status of the SAP resource to OK.

  4. Evaluate the failure history.

    Based on the failure history, the fault monitor completes one of the following actions.

    • No action

    • Local restart

    • Failover