Professional Documents
Culture Documents
Page 1 of 21
Table of Contents
1 - Conceptual overview...........................................................................................................................................................3 2 - About this paper..................................................................................................................................................................4 3 - Description of the target setup.............................................................................................................................................5 3.1 - Cluster configuration...................................................................................................................................................5 3.2 - Oracle database..........................................................................................................................................................5 3.3 - SAP System Central Services (SCS)................................................................................................................................6 3.4 - SAP Replicated Enqueue Server....................................................................................................................................6 3.5 - SAP Central Instance....................................................................................................................................................6 4 - Performing the installation..................................................................................................................................................8 4.1 - Solaris and Sun Cluster installation..............................................................................................................................8 4.2 - Basic Cluster configuration...........................................................................................................................................8 4.3 - Cluster data services configuration (part I)....................................................................................................................8 4.4 - SAP/Oracle Installation..............................................................................................................................................10 4.5 - Prepare SAP/Oracle switchover...................................................................................................................................11 4.6 - Test SAP/Oracle switchover........................................................................................................................................12 4.7 - Enable enqueue replication........................................................................................................................................12 4.8 - Test the enqueue replication......................................................................................................................................13 4.9 - Cluster data services configuration (part II).................................................................................................................14 4.10 - Enable and test the cluster.......................................................................................................................................16 5 - Appendix...........................................................................................................................................................................17 5.1 - Default profile...........................................................................................................................................................17 5.2 - ERS11 start profile......................................................................................................................................................17 5.3 - ERS11 instance profile................................................................................................................................................17 5.4 - SCS01 start profile......................................................................................................................................................18 5.5 - SCS01 instance profile................................................................................................................................................19 5.6 - JC00 start profile........................................................................................................................................................19 5.7 - JC00 instance profile...................................................................................................................................................20 5.8 - Script startsap_cluster.sh...........................................................................................................................................20 5.9 - Script stopsap_cluster.sh...........................................................................................................................................21
Page 2 of 21
1 - Conceptual overview
The Enqueue Server is a critical single point of failure in SAP architectures. And furthermore - as the Enqueue Server holds its data in memory - a failure would mean to loose the central SAP enqueue table. As a consequence, all ongoing SAP transactions having an active lock would abort. And special only to the SAP JAVA-stack, all SAP application instances will automatically restart as soon as the Enqueue Server is online again (and having a new empty enqueue table with a new ID). To overcome this drawback, SAP strongly recommends to use the standalone Enqueue Server (as part of the SAP System Central Services) together with the Replication Enqueue Server especially in productive JAVA-stack systems. The Replication Enqueue Server runs on another host and contains a replica of the enqueue table (the replication table). Enqueue Server and Replicated Enqueue Server are running in a synchronous replication mode. Thus if the Enqueue Server fails and becomes online again, the enqueue table is not lost. Instead, the Enqueue Server can recover the enqueue table from the replication table. The SAP enqueue replication concept is based on an underlying HA software and can't work without that. Sun Cluster supports this architecture out-of-the-box by providing best suitable product features: Provides a robust and reliable cluster framework. Provides data agents for the basic infrastructure (Storage, Network). Provides data agents for the SAP and database applications. In this context especially for the SAP SCS (System Central Services: Message Server and Enqueue Server) and the Replicated Enqueue Server. Handles the particular needs of Enqueue Server and Replicated Enqueue Server in a failover environment If Enqueue Server fails, Sun Cluster will restart the Enqueue Server on the cluster node (= physical server) that is currently hosting the Replicated Enqueue Server. This is mandatory, because the restarted Enqueue Server will recover the enqueue table from the replication table using a server-local access to the shared memory segment that holds the replicated table. After table recovery has finished, the Replicated Enqueue Server will be stopped. Sun Cluster will restart the Replicated Enqueue Server on another cluster node (different than the node hosting the Enqueue Server) if another cluster node is available. Thus keeping up the enqueue replication concept and maximal availability. To learn more about the SAP enqueue replication and Sun Cluster, please refer to: Sun Cluster 3.2 documentation (http://docs.sun.com/app/docs/prod/sun.cluster32) Sun Cluster 3.2 Data Service for SAP Web Application Server Guide (http://docs.sun.com/app/docs/doc/820-2568) SAP documentation (http://help.sap.com SAP NetWeaver 7.0 Library Look for the chapter "Standalone Enqueue Server")
Page 3 of 21
Page 4 of 21
SAP CI Logical Hostname SAP NW WAS Oracle DB Group Logical Hostname Oracle Listener Oracle Database Failover Filesystem ZFS (/oracle/PE2) SAP Replicated Enqueue Group Logical Hostname SAP Replicated Enqueue Server SAP SCS Group Logical Hostname NFS Share (/sapmnt/PE2, /usr/sap/trans) SAP Message Server SAP Enqueue Server Global Filesystem UFS+SVM (/usr/sap/PE2, /sapmnt/PE2, /usr/sap/trans) Local (root FS): /oracle/client /oracle/stage/102_64 Local (root FS): /oracle/client /oracle/stage/102_64
Page 5 of 21
Notes regarding SAP/Oracle filesystem configuration: /oracle/client: Local directory in root-fs. To be copied on both cluster nodes. /oracle/stage/102_64: Local directory in root-fs of the install server. Not needed for running the database. /sapmnt/PE2 and /usr/sap/PE2: Will be accessible to the database by the cluster global filesystem. No need to copy anything.
Note: Any necessary application shared data access (for example to /sapmnt/PE2) is done by using the global filesystem(s) within the cluster. This is also to avoid any problems with NFS cross-mounts between cluster nodes (that are generally not supported in a Sun Cluster configuration). The NFS server configured in this resourcegroup is to provide all cluster-external NFS-clients like additional SAP application instances with access to the shared data.
Notes regarding SAP/Oracle filesystem configuration: No dedicated filesystems needed. Global filesystems (/usr/sap/PE2, /sapmnt/PE2) will be used for instance specific data.
Page 6 of 21
Notes regarding SAP/Oracle filesystem configuration: No dedicated filesystem needed. Global filesystems (/usr/sap/PE2, /sapmnt/PE2) will be used for instance specific data.
Page 7 of 21
Network configuration
#eepromlocalmacaddress?=true
(tobeexecutedonbothclusternodes)
Hostnames Add all logical hostnames needed to the local /etc/hosts on sscsapx1 and sscsapx2
192.168.14.24pe2oralhpe2oralh.abc.de#logicalhostforOracleDB 192.168.14.23pe2scslhpe2scslh.abc.de#logicalhostforSAPSCS01 192.168.14.25pe2erslhpe2erslh.abc.de#logicalhostforSAPERS11 192.168.14.22pe2cilhpe2cilh.abc.de#logicalhostforSAPJC00
Test:
SAP System Central Services (SCS) a) Create SVM Diskset and cluster devicegroup Check if /kernel/drv/md.conf identical on both cluster nodes
#cldevicelistv #metasetspe2scs_storahsscsapx1sscsapx2 #cldevicegroupshow #cldevicegroupstatus #cldevicegroupsetp<name>=<value>pe2scs_stor #cldevicegroupswitchnsscsapx2pe2scs_stor #cldevicegroupswitchnsscsapx1pe2scs_stor
#metasetspe2scs_stora/dev/did/rdsk/d11 #metainitspe2scs_stord100pe/dev/did/rdsk/d1110G #metainitspe2scs_stord101p/dev/did/rdsk/d11s020G #metainitspe2scs_stord102p/dev/did/rdsk/d11s0all #newfs/dev/md/pe2scs_stor/rdsk/d100 #newfs/dev/md/pe2scs_stor/rdsk/d101 #newfs/dev/md/pe2scs_stor/rdsk/d102 #mkdirp/sapmnt/PE2 (tobeexecutedonbothclusternodes) #mkdirp/usr/sap/PE2 (tobeexecutedonbothclusternodes) #mkdirp/usr/sap/trans (tobeexecutedonbothclusternodes)
#clresourcegroupcreatensscsapx1,sscsapx2pe2ci #clreslogicalhostnamecreategpe2cihpe2cilhNsc_ipmp0@sscsapx1,sc_ipmp0@sscsapx2pe2ci_lh
#clresourcegroupcreatensscsapx2,sscsapx1pe2ers
Page 9 of 21
#clresourcegroupswitchnsscsapx1pe2ci #clresourcegroupswitchnsscsapx2pe2ci
Instance profile Create the instance profile /sapmnt/PE2/profile/PE2_ERS11_pe2erslh. You find the file for reuse in the appendix (Chapter ERS11 instance profile). Please pay attention to comments given in the file. Some changes have to be done (compared to the SAP documentation) because of Sun Cluster specifics. Start profile You may want to create a start profile. This is optional, because Sun Cluster will start the server-process directly (by executing the command: /usr/sap/PE2/SYS/exe/run/enrepserver pf=/sapmnt/PE2/profile/PE2_ERS11_pe2erslh). In this way, no start profile is being used. If you want to start the server-process manually, you can do it in the same way. Just if you want to use startsap (startsap r3 ERS11 pe2erslh), you have to provide the start profile /sapmnt/PE2/profile/START_ERS11_pe2erslh. You find the file for reuse in the appendix (Chapter ERS11 start profile).
Disable sapcpe Copying the SAP Kernel from /sapmnt/PE2/exe to the instance-specific directories /usr/sap/PE2/<instancename>/exe does not make sense, because it's all on the global filesystem(s). Instead start directly from /usr/sap/PE2/SYS/exe/run (that is a softlink to /sapmnt/PE2/exe). Set these parameters in all start profiles and instance profiles:
DIR_CT_RUN=/usr/sap/PE2/SYS/exe/run DIR_EXECUTABLE=/usr/sap/PE2/SYS/exe/run
Check and adjust environment of OS users pe2adm and orape2 to point to the correct directory
PATH=...:/usr/sap/PE2/SYS/exe/run:... DIR_LIBRARY=.../usr/sap/PE2/SYS/exe/run:... LD_LIBRARY_PATH=.../usr/sap/PE2/SYS/exe/run:...
In the instance start profiles, disable all of the sapcpe calls like this one:
Execute_00=immediate$(DIR_CT_RUN)/sapcpe$(FT_EXE)pf=$(_PF)$(_CPARG0)
Page 10 of 21
Delete the existing (already copied) files in the instance-specific directories /usr/sap/PE2/<instancename>/ exe.
sapdp003200/tcp#SAPSystemDispatcherPort sapdp013201/tcp#SAPSystemDispatcherPort sapdp113211/tcp#SAPSystemDispatcherPort sapgw003300/tcp#SAPSystemGatewayPort sapgw013301/tcp#SAPSystemGatewayPort sapgw113311/tcp#SAPSystemGatewayPort sapdp00s4700/tcp#SAPSystemDispatcherSecurityPort sapdp01s4701/tcp#SAPSystemDispatcherSecurityPort sapdp11s4711/tcp#SAPSystemDispatcherSecurityPort sapgw00s4800/tcp#SAPSystemGatewaySecurityPort sapgw01s4801/tcp#SAPSystemGatewaySecurityPort sapgw11s4811/tcp#SAPSystemGatewaySecurityPort
Hosts Check file /etc/hosts to contain all logical hosts and physical nodes. Mountpoints for failover filesystems Make sure, that the mountpoint /oracle/PE2 is available on all nodes. Java J2SE Install the most recent version of J2SE 1.4.2.x SDK on a global filesystem. Download self-extracting version von http://java.sun.com Install into directory /usr/sap/PE2/j2se Modify environment of user pe2adm: JAVA_HOME=/usr/sap/PE2/j2se Modify JC00 instance profile: jstartup/vm/home = /usr/sap/PE2/j2se Note: For Solaris x64 you need to download a version from http://java.sun.com/j2se/1.4.2/SAPsite/download.html. JCE policy files Download from http://java.sun.com/javase/downloads and extract to: Page 11 of 21
saposcol directory Create a local working directory /usr/sap/tmp for saposcol on both nodes (owner: root, group: sapsys, permissions: drwxrwxr-x). Oracle client Copy directory /oracle/client (from the Oracle-installation node) to the other nodes. Oracle inventory Relocate the Oracle inventory to shared storage. On the Oracle-installation node; Modify the entry in /var/opt/oracle/oraInst.loc: inventory_loc=/oracle/PE2/oraInventory Copy directory /var/opt/oracle to the other nodes Move directory /oracle/oraInventory to /oracle/PE2/oraInventory
To switch resourcegroups (containing storage and IP) between the cluster nodes:
#clrgswitchn<targetnode><resourcegroup>
with <target-node> = sscsapx1 or sscsapx2 with <resourcegroup> = pe2scs, pe2ers, pe2ora or pe2ci
Parameters for JC00 (and all other application instances) Configured in the default profile:
enque/deque_wait_answer=TRUE
Parameters for ERS11 Nothing more to do, if you have reused the instance profile from the appendix of this paper.
3) Check the enqueue table ID On sscsapx1 (the current node hosting SCS01, containing the Enqueue Server):
#enqtpf=/sapmnt/PE2/profile/PE2_SCS01_pe2scslh97 #enqtpf=/sapmnt/PE2/profile/PE2_ERS11_pe2erslh97
On sscsapx2 (the current node hosting ERS11, containing the Replicated Enqueue Server): The output should be identical and look like this:
4) Create enqueue table entries On sscsapx2 (the current node hosting ERS11, containing the Replicated Enqueue Server):
#enqtpf=/sapmnt/PE2/profile/PE2_ERS11_pe2erslh1120
This command will create 20 dummy entries in the table. 5) View enqueue table entries Page 13 of 21
Sun Microsystems GmbH On sscsapx1 (the current node hosting SCS01, containing the Enqueue Server):
#enqtpf=/sapmnt/PE2/profile/PE2_SCS01_pe2scslh20 #enqtpf=/sapmnt/PE2/profile/PE2_ERS11_pe2erslh20
On sscsapx2 (the current node hosting ERS11, containing the Replicated Enqueue Server): The output should be identical and contain 20 entries like this (and maybe some others):
000ENQTENQ_PERFXenqueueperformancetest11111111000
6) Perform switchover Stop the instance SC01 on node sscsapx1 and start it on node sscsapx2. See chapter Test SAP/Oracle switchover on how to start, stop and switch the applications (in this installation phase, without having a complete cluster integration). 7) Check the success The Enqueue Server should have stopped the Replicated Enqueue Server on node sscsapx2. Check if the OS process is gone. It is the process command name er.sapPE2_ERS11, if you have started ERS11 with startssap (having a start profile). Otherwise, if you have started the Replicated Enqueue Server directly, the process command name is enrepserver. Check if the enqueue table ID is still the same from before the switchover. Repeat step 3, solely regarding SCS01 (because ERS11 should be stopped). Remember that the node has changed from sscsapx1 to sscsapx2 ! Check if the 20 enqueue table entries still exist. Repeat step 4, solely regarding SCS01 (because ERS11 should be stopped). Remember that the node has changed from sscsapx1 to sscsapx2 ! Note. In the case, that the replication does not work correctly, you can use these files foe debugging: Look for the developer traces dev_en* in the directories /usr/sap/PE2/SCS01/work and /usr/sap/ERS11/SCS01/work. Attention: If you have started the Replicated Enqueue Server directly (not using startsap and a start profile), then you will find the trace files of the Replicated Enqueue Server in the home directory of user pe2adm. Not yet, but in the final configuration, Sun Cluster will also start the Enqueue Server directly (not using startsap and a start profile). Thus, you will find also these trace files in the home directory of user pe2adm. If needed, increase the trace level. Set parameter rdisp/TRACE = 3 in the instance profiles of SCS01 and ERS11.
You find them in the appendix. Sun Cluster will call them to start and stop the SAP instances SCS01 and JC00. Oracle database a) Create Oracle monitor-user and table Start the oracle database. Use OS user orape2 to connect to the db:
b) Resource for Oracle database Stop database, if running. Then create the cluster resource:
Page 14 of 21
c) Resource for Oracle listener Stop listener, if running. Then create the cluster resource:
SAP System Central Services (SCS) a) Remove the Enqueue Server from instance start Disable the startup in the start profile "/sapmnt/PE2/profile/START_SCS01_pe2scslh". Remove these lines in the section Start SAP locking service:
_EN=en.sap$(SAPSYSTEMNAME)_$(INSTANCE_NAME) Execute_03=localrmf$(_EN) Execute_04=locallnsf$(DIR_EXECUTABLE)/enserver$(FT_EXE)$(_EN) Start_Program_01=local$(_EN)pf=$(DIR_PROFILE)/PE2_SCS01_pe2scslh
Note. You can start the Enqueue Server directly (and Cluster will do it in this way): b) Resource for Enqueue Server Stop instance SCS01, if running. Then create the cluster resource:
#/usr/sap/PE2/SCS01/exe/enserverpf=/sapmnt/PE2/profile/PE2_SCS01_pe2scslh
c) Resource for SCS01 (remaining Message Server) Stop instance SCS01, if running. Then create the cluster resource:
#clresourcecreatedgpe2scstSUNW.sapscs\ pResource_project_name=PE2\ psap_sid=PE2\ psap_instance_number=01\ psap_instance_name=SCS01\ pmsg_server_port=3901\ pscs_startup_script=/usr/sap/PE2/pe2adm/startsap_cluster.sh\ pscs_shutdown_script=/usr/sap/PE2/pe2adm/stopsap_cluster.sh\ presource_dependencies=pe2scs_stor,pe2ora_db{ANY_NODE},pe2ora_lsnr{ANY_NODE}\ pe2scs_ms
SAP Central Instance a) Resource for JC00 Stop instance JC00, if running. Then create the cluster resource:
#clresourcecreatedgpe2citSUNW.sapwebas\ pResource_project_name=PE2\ psap_sid=PE2\ psap_instance_number=00\ psap_instance_name=JC00\ psap_instance_type=J2EE\ pwebas_startup_script=/usr/sap/PE2/pe2adm/startsap_cluster.sh\ pwebas_shutdown_script=/usr/sap/PE2/pe2adm/stopsap_cluster.sh\ presource_dependencies=pe2scs_stor{ANY_NODE},pe2ora_db{ANY_NODE},\ pe2ora_lsnr{ANY_NODE},pe2scs_enq_1{ANY_NODE},pe2scs_ms{ANY_NODE}\ pe2ci_jc00
Page 15 of 21
SAP Replicated Enqueue Server a) Resource for Replicated Enqueue Server (instance ERS11) Stop Replicated Enqueue Server (Instance ERS11), if running. Then create the cluster resource:
Group affinities Configure these resourcegroup affinities to reflect the special failover requirements of the SAP enqueue replication concept.
#clresourcegroupsetpRG_affinities=+pe2erspe2scs
The weak positive affinity setting ensures that, in case of failover, the group pe2scs (SCS01, including Enqueue Server) fails over to the node where the group pe2ers (ERS11, Replicated Enqueue Server) is running.
#clresourcegroupsetpRG_affinities=pe2scspe2ers
The strong negative affinity setting: The group pe2ers (ERS11, Replicated Enqueue Server) is never brought online nor allowed to remain online on a node on which the group pe2scs (SCS01, including Enqueue Server) is online.
with <target-node> = sscsapx1 or sscsapx2 with <resourcegroup> = pe2scs, pe2ers, pe2ora or pe2ci Check if the evacuation of the Replicated Enqueue Server is working, as specified in the section Group affinities above. SAP enqueue replication Test the enqueue replication again, as already described in the chapter Test the enqueue replication. Verify that JC00 (as enqueue client) is not doing a restart, after group pe2scs (SCS01, including Enqueue Server) has done an switchover or failover. Check the enqueue clients Check, if the JAVA enqueue clients (all SAP application instances) will continue to work without a restart, after a SCS01 failover or switchover.
Page 16 of 21
5 - Appendix
5.1 - Default profile
File /sapmnt/PE2/profile/DEFAULT.PFL
SAPSYSTEMNAME=PE2 SAPGLOBALHOST=pe2scslh # #SAPCentralServiceInstanceforJ2EE # j2ee/scs/host=pe2scslh j2ee/scs/system=01 j2ee/ms/port=3901 SAPDBHOST=pe2oralh j2ee/dbtype=ora j2ee/dbname=PE2 j2ee/dbhost=pe2oralh DIR_PUT=/usr/sap/$(SAPSYSTEMNAME)/put #Enableenqueuereplicationforallclients(=appinstances) enque/deque_wait_answer=TRUE
Page 17 of 21
Page 18 of 21
Page 19 of 21
Page 20 of 21
Page 21 of 21