ONLINE-EXTRA CONTENT

Configuring a Highly Available Linux Cluster for SAP Services By David Detweiler, Achim Lernhard, Florenz Kley, Thorsten Staerk, and Wolfgang Trenkle

Example instance profiles and start profiles

# abap/buffersize - Program Buffer Size abap/buffersize = 200000

# rsdb/cua/buffersize - Size of CUA Buffer

Administrators should rename these files to show the system ID

rsdb/cua/buffersize = 5000

and adapt the parameters accordingly. rsdb/obj/buffersize

= 10240

RAC_DVBGS00_ls3221

rsdb/esm/buffersize_kb = 10240

# $Id: RAC_DVBGS00_ls3221,v 1.4 2005/01/28 02:13:38

rsdb/obj/max_objects = 10000 rsdb/esm/max_objects = 10000

fl Exp $ #

rsdb/obj/large_object_size = 16384

SAPSYSTEMNAME = RAC

rsdb/esm/large_object_size = 16384

INSTANCE_NAME = DVBGS00 SAPSYSTEM

# zcsa/presentation_buffer_area - Size of the buffer

= 00

allocated for screens (Dynpros) # the hostname here should be the virtual IP for the

zcsa/presentation_buffer_area = 50000000 # max entries in zcsa/presentation_buffer_area

app server rdisp/myname = ls3216_RAC_00

sap/bufdir_entries = 5000 # zcsa/table_buffer_area - Size of Resident-Table Buffer

rdisp/wp_no_dia = 2 rdisp/wp_no_vb

zcsa/table_buffer_area = 90000000

= 1

# zcsa/db_max_buftab - Directory Entries in Table

rdisp/wp_no_vb2 = 0

Buffer

rdisp/wp_no_enq = 0 rdisp/wp_no_btc = 1

zcsa/db_max_buftab = 20000

rdisp/wp_no_spo = 1

# calendar zcsa/calendar_area = 800000 zcsa/calendar_ids = 400

rdisp/start_icman = false #icm/max_threads = 10

# number of no range buffer entries

#icm/min_threads = 5

nobuf/max_no_buffer_entries = 20001 # J2EE rdisp/keepalive = 0

rdisp/j2ee_start = 0

rdisp/max_comm_entries = 1200 es/implementation = map PHYS_MEMSIZE = 2048

# rtbb/buffer_length - Size of partial table bufferers

em/initial_size_MB=512

rtbb/buffer_length = 20000 # rtbb/max_tables - Number of Buffer Directory Entries

# shared mem pools ipc/shm_psize_10 = 150000000

rtbb/max_tables = 900

ipc/shm_psize_40 = 200000000 rdisp/vbname = $(rdisp/myname) # abap/heap_area_dia - Limit of heap per Emode on rdisp/wp_ca_blocks = 1000

Dialogprozesses abap/heap_area_dia = 900000000

rdisp/wp_ca_blk_no = 1000

# abap/heap_area_nondia - Limit of heap per Emode on Batch or VB or Spool abap/heap_area_nondia = 1

ipc/sem_pr_set_count = 1 stat/as_bufsize = 200000 stat/bufsize = 200000

February 2006

Reprinted from Dell Power Solutions, February 2006. Copyright © 2006 Dell Inc. All rights reserved.

DELL POWER SOLUTIONS

11

ONLINE-EXTRA CONTENT

Configuring a Highly Available Linux Cluster for SAP Services, continued

RAC_DM01_ls3221 ztta/roll_extension = 768000000

# $Id: RAC_DM01_ls3221,v 1.4 2005/01/28 02:13:38 fl Exp $ #

START_DVBGS00_ls3221

SAPSYSTEMNAME = RAC

# $Id: START_DVBGS00_ls3221,v 1.1 2005/01/26 18:11:29

INSTANCE_NAME = DM01

fl Exp $

SAPSYSTEM = 01

# #---------------------------------------------------MYHOST

=ls3221

SAPSYSTEMNAME

=RAC

INSTANCE_NAME

=DVBGS00

# the hostname here should be the virtual IP for the message server rdisp/myname = ls3221_RAC_01

#ms/standalone = 1 #---------------------------------------------------# start SCSA admin program

rdisp/wp_no_dia = 2

#----------------------------------------------------

rdisp/wp_no_vb = 0 rdisp/wp_no_vb2 = 0

Execute_00 =local $(DIR_EXECUTABLE)/sapmscsa -n

rdisp/wp_no_enq = 0

pf=$(DIR_PROFILE)/$(SAPSYSTEMNAME)_$(INSTANCE_

rdisp/wp_no_btc = 0

NAME)_$(MYHOST)

rdisp/wp_no_spo = 0

#----------------------------------------------------

rdisp/start_icman = false

# start application server #----------------------------------------------------

es/implementation = map PHYS_MEMSIZE = 2048

_DW

=dw.sap$(SAPSYSTEMNAME)_

em/initial_size_MB=512

$(INSTANCE_NAME) Execute_01

=local rm -f $(_DW)

Execute_02

=local ln -s -f $(DIR_EXECUTABLE)/

disp+work $(_DW) Start_Program_01

# abap/heap_area_dia - Limit of heap per Emode on Dialogprozesses abap/heap_area_dia = 900000000

=local $(_DW) pf=$(DIR_PROFILE)/

$(SAPSYSTEMNAME)_$(INSTANCE_NAME)_$(MYHOST)

# abap/heap_area_nondia - Limit of heap per Emode on Batch or VB or Spool abap/heap_area_nondia = 900000000

#----------------------------------------------------

# abap/buffersize - Program Buffer Size

# start syslog send daemon

abap/buffersize = 240000

#----------------------------------------------------

# rsdb/cua/buffersize - Size of CUA Buffer rsdb/cua/buffersize = 5000

_SE

=se.sap$(SAPSYSTEMNAME)_ $(INSTANCE_NAME)

# zcsa/presentation_buffer_area - Size of the buffer allocated for screens (Dynp

Execute_05

=local rm -f $(_SE)

zcsa/presentation_buffer_area = 20000000

Execute_06

=local ln -s -f $(DIR_EXECUTABLE)/

# zcsa/table_buffer_area - Size of Resident-Table Buffer

rslgsend $(_SE) Start_Program_03

=local $(_SE) -F pf=$(DIR_PROFILE)/

$(SAPSYSTEMNAME)_$(INSTANCE_NAME)_$(MYHOST)

zcsa/table_buffer_area = 50000000 # zcsa/db_max_buftab - Directory Entries in Table Buffer

#----------------------------------------------------

zcsa/db_max_buftab = 10000 # rtbb/buffer_length - Size of partial table bufferers rtbb/buffer_length = 20000

February 2006

Reprinted from Dell Power Solutions, February 2006. Copyright © 2006 Dell Inc. All rights reserved.

DELL POWER SOLUTIONS

2

ONLINE-EXTRA CONTENT

Configuring a Highly Available Linux Cluster for SAP Services, continued

# rtbb/max_tables - Number of Buffer Directory Entries

disp+work $(_DW) Start_Program_02

rtbb/max_tables = 500

=local $(_DW) pf=$(DIR_PROFILE)/

$(SAPSYSTEMNAME)_$(INSTANCE_NAME)_$(MYHOST)

# em/max_size_MB - The maximum size of extended memory pool em/max_size_MB = 512

#----------------------------------------------------

# em/address_space_MB - The size of the address space

# start syslog collector daemon

em/address_space_MB = 512

#---------------------------------------------------_CO

=co.sap$(SAPSYSTEMNAME)_$(INSTANCE_NAME)

ipc/shm_psize_10 = 88000000

Execute_05

=local rm -f $(_CO)

ipc/shm_psize_40 = 70000000

Execute_06

=local ln -s -f $(DIR_EXECUTABLE)/

rdisp/ROLL_SHM = 32768

rslgcoll $(_CO) Start_Program_03

rdisp/ROLL_MAXFS = 32768

=local $(_CO) -F pf=$(DIR_

ztta/roll_area = 104857600

PROFILE)/$(SAPSYSTEMNAME)_$(INSTANCE_NAME)_

rdisp/PG_SHM = 32768

$(MYHOST)

rdisp/PG_MAXFS = 32768 #---------------------------------------------------# start syslog send daemon START_DM01_ls3221

#----------------------------------------------------

# $Id: START_DM01_ls3221,v 1.2 2005/01/27 11:18:47 fl

_SE

=se.sap$(SAPSYSTEMNAME)_$(INSTANCE_NAME)

Execute_07

=local rm -f $(_SE)

Execute_08

=local ln -s -f $(DIR_EXECUTABLE)/

Exp $ #

rslgsend $(_SE)

MYHOST=ls3221

Start_Program_04

SAPSYSTEMNAME=RAC INSTANCE_NAME=DM01

=local $(_SE) -F pf=$(DIR_PROFILE)/

$(SAPSYSTEMNAME)_$(INSTANCE_NAME)_$(MYHOST)

#----------------------------------------------------

#----------------------------------------------------

# SCSA-Verwaltung starten #---------------------------------------------------Execute_00 = local $(DIR_EXECUTABLE)/sapmscsa -n pf=$(DIR_PROFILE)/$(SAPSYSTEMNAME)_$(INSTANCE_

RAC_E02_ls3222 # $Id: RAC_E02_ls3222,v 1.2 2005/01/28 02:13:38 fl Exp $

NAME)_$(MYHOST) # #----------------------------------------------------

SAPSYSTEMNAME

# start message server

INSTANCE_NAME

= RAC = E02

#----------------------------------------------------

SAPSYSTEM

= 02

Execute_01 = local rm -f $(_MS)

enque/server/threadcount

= 1

Execute_02 = local ln -s -f $(DIR_EXECUTABLE)/

enque/server/replication

= true

_MS = ms.$(SAPSYSTEMNAME)_$(INSTANCE_NAME)

msg_server $(_MS) Start_Program_01 = local $(_MS) pf=$(DIR_PROFILE)/ $(SAPSYSTEMNAME)_$(INSTANCE_NAME)_$(MYHOST)

# default 300 #enque/enrep/stop_timeout_s = 300

#----------------------------------------------------

# default: NULL

# start application server

#enque/enrep/stop_retries =

#---------------------------------------------------_DW

=dw.sap$(SAPSYSTEMNAME)_$(INSTANCE_NAME)

Execute_03

=local rm -f $(_DW)

Execute_04

=local ln -s -f $(DIR_EXECUTABLE)/

February 2006

# only if enque table >80 MB (then read OSS note 654744) # default 1000

Reprinted from Dell Power Solutions, February 2006. Copyright © 2006 Dell Inc. All rights reserved.

DELL POWER SOLUTIONS

3

ONLINE-EXTRA CONTENT

Configuring a Highly Available Linux Cluster for SAP Services, continued

#enque/enrep/req_block_count =

RAC_R02 # $Id: RAC_R02,v 1.2 2005/01/28 02:13:38 fl Exp $

ipc/shm_psize_34 = 0

#

START_E02_ls3222

SAPSYSTEMNAME

= RAC

INSTANCE_NAME

= R02

SAPSYSTEM

= 02

# $Id: START_E02_ls3222,v 1.1 2005/01/27 19:37:32 fl Exp $

enque/enrep/poll_interval = 0

#

ipc/shm_psize_34 = 0

MYHOST=ls3222 SAPSYSTEMNAME=RAC INSTANCE_NAME=E02

START_R02 # $Id: START_R02,v 1.1 2005/01/27 19:37:32 fl Exp $

#----------------------------------------------------

#

# SCSA-Verwaltung starten

SAPSYSTEMNAME=RAC

#----------------------------------------------------

INSTANCE_NAME=R02

Execute_00 = local $(DIR_EXECUTABLE)/sapmscsa -n pf=$(DIR_PROFILE)/$(SAPSYSTEMNAME)_$(INSTANCE_

#----------------------------------------------------

NAME)_$(MYHOST)

# SCSA-Verwaltung starten #----------------------------------------------------

#----------------------------------------------------

Execute_00 = local $(DIR_EXECUTABLE)/sapmscsa -n

# start standalone enqueue server

pf=$(DIR_PROFILE)/$(SAPSYSTEMNAME)_$(INSTANCE_

#----------------------------------------------------

NAME)

_EN

=en.sap$(SAPSYSTEMNAME)_$(INSTANCE_NAME)

Execute_01

=local rm -f $(_EN)

#----------------------------------------------------

Execute_02

=local ln -s -f $(DIR_EXECUTABLE)/

# start enqueue replication server

enserver $(_EN) Start_Program_01

#---------------------------------------------------=local $(_EN) pf=$(DIR_PROFILE)/

_ER

$(SAPSYSTEMNAME)_$(INSTANCE_NAME)_$(MYHOST)

#----------------------------------------------------

Execute_01

=local rm -f $(_ER)

Execute_02

=local ln -s -f $(DIR_EXECUTABLE)/

# start syslog send daemon

enrepserver $(_ER)

#---------------------------------------------------_SE

=se.sap$(SAPSYSTEMNAME)_$(INSTANCE_NAME)

Execute_03

=local rm -f $(_SE)

Execute_04

=local ln -s -f $(DIR_EXECUTABLE)/

rslgsend $(_SE) Start_Program_02

=er.sap$(SAPSYSTEMNAME)_ $(INSTANCE_NAME)

Start_Program_01

=local $(_ER) pf=$(DIR_PROFILE)/

$(SAPSYSTEMNAME)_$(INSTANCE_NAME)

#---------------------------------------------------# start syslog send daemon

=local $(_SE) -F pf=$(DIR_

PROFILE)/$(SAPSYSTEMNAME)_$(INSTANCE_NAME)_ $(MYHOST)

#---------------------------------------------------_SE

=se.sap$(SAPSYSTEMNAME)_ $(INSTANCE_NAME)

#----------------------------------------------------

Execute_03

=local rm -f $(_SE)

Execute_04

=local ln -s -f $(DIR_EXECUTABLE)/

rslgsend $(_SE) Start_Program_02

=local $(_SE) -F pf=$(DIR_

PROFILE)/$(SAPSYSTEMNAME)_$(INSTANCE_NAME)

#----------------------------------------------------

February 2006

Reprinted from Dell Power Solutions, February 2006. Copyright © 2006 Dell Inc. All rights reserved.

DELL POWER SOLUTIONS

4

ONLINE-EXTRA CONTENT

Configuring a Highly Available Linux Cluster for SAP Services, continued

System V init scripts

#---------------------------------------------------#

sapappserver-RAC

# try not to mess with these parameters

#!/bin/sh

#

# $Id: sapappserver-RAC,v 1.4 2005/01/28 02:13:38 fl

INSTANCE_NAME=${INSTANCE}${SAPSYSTEM}

Exp $

HOSTNAME=`hostname`

#

DIR_EXE=/usr/sap/${SAPSYSTEMNAME}/SYS/exe/run

# Startup scripts for SAP App server processes

DIR_PROFILE=/usr/sap/${SAPSYSTEMNAME}/SYS/profile

#

DIR_WORK=/usr/sap/${SAPSYSTEMNAME}/${INSTANCE_NAME}/ work

# chkconfig: - 99 01 # description: SAP R/3 system application services

START_PROFILE=${DIR_PROFILE}/START_${INSTANCE_NAME}_

#

${HA_HOSTNAME}

# Copyright (C) Red Hat, Inc.

2004

START_CMD=${DIR_EXE}/sapstart

# Copyright (C) Dell, Inc.

2004,2005

prog=“sapappsrv-$SAPSYSTEMNAME“

#

progname=“SAP app server $SAPSYSTEMNAME“

# This program is free software; you can redistribute

statusname=dw.sap${SAPSYSTEMNAME}_${INSTANCE_NAME}

# it and/or modify it under the terms of the GNU # General Public License as published by the Free

RETVAL=0

# Software Foundation; either version 2 of the # License, or (at your option) any later version.

homedir() {

#

eval echo „~$1“

# This program is distributed in the hope that it

}

# will be useful, but WITHOUT ANY WARRANTY; without # even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE.

start() {

See the

echo -n $“Starting $progname: „

# GNU General Public License for more details. #

daemon su - -c „source\ $DIR_PROFILE/sapenv_

# You should have received a copy of the GNU General

${INSTANCE_NAME}.sh;$START_CMD\ pf=$START_

# Public License along with this program; if not,

PROFILE“ „$SIDADM“

# write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA

RETVAL=$?

02111-1307

echo

# USA

touch /var/lock/subsys/$prog

#

echo `pidof $statusname` >/var/run/${statusname}.pid

# Authors:

Nils Philippsen

#

Florenz Kley

return $RETVAL



# source function library

}

stop() {

. /etc/init.d/functions

echo -n $“Stopping $progname: „

. /etc/init.d/sap_rep_enq.functions

daemon su - -c „source\ $DIR_PROFILE/sapenv_ ${INSTANCE_NAME}.sh;${DIR_WORK}/kill.sap“

#---------------------------------------------------#

„$SIDADM“

# Configure these parameters to match your system # SAPSYSTEMNAME=RAC INSTANCE=DVBGS

until is_stopped;do /bin/sleep 2 done

SAPSYSTEM=00 SIDADM=racadm

RETVAL=$?

HA_HOSTNAME=ls3221

echo rm -f /var/lock/subsys/$prog

February 2006

Reprinted from Dell Power Solutions, February 2006. Copyright © 2006 Dell Inc. All rights reserved.

DELL POWER SOLUTIONS

5

ONLINE-EXTRA CONTENT

Configuring a Highly Available Linux Cluster for SAP Services, continued

rm -f /var/run/${statusname}.pid

sapmsgsrv-RAC

return $RETVAL

#!/bin/sh

}

# $Id: sapmsgsrv-RAC,v 1.9 2005/01/28 02:13:38 fl

reload(){

#

Exp $

stop

# Startup script for SAP R/3 message server

start

#

}

# chkconfig: - 99 01 # description: SAP R/3 system Message Server

restart(){

#

stop

# Copyright (C) Red Hat, Inc.

2004

start

# Copyright (C) Dell, Inc.

2004,2005

}

# # This program is free software; you can redistribute # it and/or modify it under the terms of the GNU

condrestart(){ [ -e /var/lock/subsys/$prog ] && restart

# General Public License as published by the Free

return 0

# Software Foundation; either version 2 of the

}

# License, or (at your option) any later version. #

case „$1“ in

# This program is distributed in the hope that it

start)

# will be useful, but WITHOUT ANY WARRANTY; without

start

# even the implied warranty of MERCHANTABILITY or

;;

# FITNESS FOR A PARTICULAR PURPOSE.

stop)

See the

# GNU General Public License for more details.

stop

#

;;

# You should have received a copy of the GNU General

status)

# Public License along with this program; if not,

status $statusname

# write to the Free Software Foundation, Inc.,

RETVAL=$?

# 59 Temple Place, Suite 330, Boston, MA

02111-1307

# USA

;; restart)

#

restart ;; reload)

# Authors:

Nils Philippsen

#

Florenz Kley





#

reload

# source function library

;;

. /etc/init.d/functions

*)

. /etc/init.d/sap_rep_enq.functions

echo $“Usage: $0 {start|stop|restart|reload}“ RETVAL=1 esac

#---------------------------------------------------# # Configure these parameters to match your system #

exit $RETVAL

SAPSYSTEMNAME=RAC INSTANCE=DM SAPSYSTEM=01 SIDADM=racadm HA_HOSTNAME=ls3221 HOSTNAME=`hostname`

February 2006

Reprinted from Dell Power Solutions, February 2006. Copyright © 2006 Dell Inc. All rights reserved.

DELL POWER SOLUTIONS

6

ONLINE-EXTRA CONTENT

Configuring a Highly Available Linux Cluster for SAP Services, continued

#---------------------------------------------------#

RETVAL=$?

# try not to mess with these parameters

echo

#

rm -f /var/lock/subsys/$prog

INSTANCE_NAME=${INSTANCE}${SAPSYSTEM}

rm -f /var/run/${statusname}.pid

DIR_EXE=/usr/sap/${SAPSYSTEMNAME}/SYS/exe/run DIR_PROFILE=/usr/sap/${SAPSYSTEMNAME}/SYS/profile

return $RETVAL }

DIR_WORK=/usr/sap/${SAPSYSTEMNAME}/${INSTANCE_NAME}/ work

reload(){

START_PROFILE=${DIR_PROFILE}/START_${INSTANCE_NAME}_

stop

${HA_HOSTNAME}

start

START_CMD=${DIR_EXE}/sapstart

}

prog=»sapmsgsrv-$SAPSYSTEMNAME» progname=»SAP message server $SAPSYSTEMNAME»

restart(){

statusname=ms.${SAPSYSTEMNAME}_${INSTANCE_NAME}

stop start

RETVAL=0

}

homedir() {

condrestart(){ [ -e /var/lock/subsys/$prog ] && restart

eval echo «~$1» }

return 0 }

start() { echo -n $»Starting $progname: «

case «$1» in start) start

#hostname $HA_HOSTNAME #cd ${DIR_WORK}

;;

daemon su - -c «source\ $DIR_PROFILE/sapenv_ ${INSTANCE_NAME}.sh;$START_CMD\ pf=$START_ PROFILE» «$SIDADM»

stop) stop ;;

#hostname $HOSTNAME

status)

RETVAL=$?

status $statusname

echo

RETVAL=$?

touch /var/lock/subsys/$prog echo `pidof $statusname` >/var/run/${statusname}.pid return $RETVAL

;; restart) restart

}

;; reload)

stop() {

reload

echo -n $»Stopping $progname: « daemon su - -c «source\ $DIR_PROFILE/sapenv_ ${INSTANCE_NAME}.sh;${DIR_WORK}/kill.sap» «$SIDADM»

;; *) echo $»Usage: $0 {start|stop|restart|reload}» RETVAL=1 esac

until is_stopped;do /bin/sleep 1

exit $RETVAL

done

February 2006

Reprinted from Dell Power Solutions, February 2006. Copyright © 2006 Dell Inc. All rights reserved.

DELL POWER SOLUTIONS

7

ONLINE-EXTRA CONTENT

Configuring a Highly Available Linux Cluster for SAP Services, continued

sapenserver-RAC

HA_HOSTNAME=ls3222

#!/bin/sh # $Id: sapenserver-RAC,v 1.3 2005/01/28 02:13:38 fl Exp $

#---------------------------------------------------# # try not to mess with these parameters

#

#

# Startup script for SAP Enqueue Server

INSTANCE_NAME=${INSTANCE}${SAPSYSTEM}

#

HOSTNAME=`hostname`

# chkconfig: - 99 01

HA_SERVICE_NAME=RAC_enqueue_server

# description: SAP R/3 Enqueue Server

DIR_EXE=/usr/sap/${SAPSYSTEMNAME}/SYS/exe/run

#

DIR_PROFILE=/usr/sap/${SAPSYSTEMNAME}/SYS/profile

# Copyright (C) Red Hat, Inc.

2004

# Copyright (C) Dell, Inc.

2004,2005

DIR_WORK=/usr/sap/${SAPSYSTEMNAME}/${INSTANCE_NAME}/ work

#

START_PROFILE=${DIR_PROFILE}/START_${INSTANCE_NAME}_

# This program is free software; you can redistribute

${HA_HOSTNAME}

# it and/or modify it under the terms of the GNU

START_CMD=${DIR_EXE}/sapstart

# General Public License as published by the Free

prog=»sapensrv-$SAPSYSTEMNAME»

# Software Foundation; either version 2 of the

progname=»SAP enqueue server $SAPSYSTEMNAME»

# License, or (at your option) any later version.

statusname=en.sap${SAPSYSTEMNAME}_${INSTANCE_NAME}

# # This program is distributed in the hope that it

RETVAL=0

# will be useful, but WITHOUT ANY WARRANTY; without # even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE.

alarm () {

See the GNU

# General Public License for more details.

/bin/true }

# # You should have received a copy of the GNU General

start() {

# Public License along with this program; if not,

# check whether I’m the host owning the enserver

# write to the Free Software Foundation, Inc.,

IP, exit if I’m not The One

# 59 Temple Place, Suite 330, Boston, MA

EN_SERVICE_OWNER=$(ha_service_owner $HA_SERVICE_

02111-1307

# USA

NAME)

# # Authors:

Nils Philippsen

#

Florenz Kley

if [ $HOSTNAME = $EN_SERVICE_OWNER ];then /bin/true



# Carry On, Jeeves

else

# # Source function library.

echo «Aborted starting $statusname on

. /etc/rc.d/init.d/functions

$HOSTNAME:»

. /etc/init.d/sap_rep_enq.functions

echo -n «

I’m not owning cluster service

#---------------------------------------------------#

echo_failure

$HA_SERVICE_NAME»

# Configure these parameters to match your system

echo

#

return -1

SAPSYSTEMNAME=RAC

fi

INSTANCE=E SAPSYSTEM=02

# check whether enserver is already running here,

SIDADM=racadm

exit if yes

HOST1=ls3219

local EN_STATUS

HOST2=ls3220

status $statusname

February 2006

Reprinted from Dell Power Solutions, February 2006. Copyright © 2006 Dell Inc. All rights reserved.

DELL POWER SOLUTIONS

8

ONLINE-EXTRA CONTENT

Configuring a Highly Available Linux Cluster for SAP Services, continued

EN_STATUS=$? until is_stopped;do if [ $EN_STATUS -eq 0 ];then

/bin/sleep 2

echo «Aborted starting $statusname:» echo -n «

done

$statusname already running here»

echo_failure

RETVAL=$?

echo return -1

rm -f /var/lock/subsys/$prog

else

rm -f /var/run/${statusname}.pid

/bin/true

# Very Good, Jeeves

fi

return $RETVAL }

# start enserver daemon su - -c «source\ $DIR_PROFILE/sapenv_

RETVAL=0

${INSTANCE_NAME}.sh;$START_CMD\ pf=$START_ PROFILE» «$SIDADM»

case “$1” in

RETVAL=$?

start)

if [ $RETVAL -eq 0 ];then

start

touch /var/lock/subsys/$prog

RETVAL=$?

echo `pidof $statusname` >/var/run/

;;

${statusname}.pid echo

stop) stop

else echo «something bad happened while running $START_CMD pf=$START_PROFILE»

RETVAL=$? ;;

return $RETVAL fi

status) status $statusname

# kick off enrepserver handling on other node echo -n $»Starting enrepserver on $(get_other_ host): «

RETVAL=$? ;; restart)

if service_other_host sapenrepserver-${SAPSYSTEMNAME}

stop

start >&/dev/null; then

start

echo_success

RETVAL=$?

# Thank You, Jeeves

echo

;;

else

*)

echo_failure

echo $”Usage: $0 {start|stop|restart|condrestart|

echo

status}”

return -1

exit 1

fi }

esac

# END start() { exit $RETVAL stop() { echo -n $”Stopping $progname: “ daemon su - -c “source\ $DIR_PROFILE/sapenv_ ${INSTANCE_NAME}.sh;${DIR_WORK}/kill.sap” “$SIDADM”

February 2006

Reprinted from Dell Power Solutions, February 2006. Copyright © 2006 Dell Inc. All rights reserved.

DELL POWER SOLUTIONS

9

ONLINE-EXTRA CONTENT

Configuring a Highly Available Linux Cluster for SAP Services, continued

sapenrepserver-RAC

#

#!/bin/sh

INSTANCE_NAME=${INSTANCE}${SAPSYSTEM}

# $Id: sapenrepserver-RAC,v 1.3 2005/01/28 02:13:38

HOSTNAME=`hostname` HA_HOSTNAME=ls3222

fl Exp $ #

HA_SERVICE_NAME=RAC_enqueue_server

# Startup script for SAP Enqueue Replication Server

DIR_EXE=/usr/sap/${SAPSYSTEMNAME}/SYS/exe/run

#

DIR_PROFILE=/usr/sap/${SAPSYSTEMNAME}/SYS/profile

# chkconfig: 99 01

DIR_WORK=/usr/sap/${SAPSYSTEMNAME}/${INSTANCE_NAME}/

# description: SAP R/3 system enqueue replication server

work START_PROFILE=${DIR_PROFILE}/START_${INSTANCE_NAME}

#

START_CMD=${DIR_EXE}/sapstart

# This program is free software; you can redistribute

prog=»sapenrepserver-$SAPSYSTEMNAME»

# it and/or modify it under the terms of the GNU

progname=»SAP enqueue replication server $SAPSYSTEM-

# General Public License as published by the Free # Software Foundation; either version 2 of the

NAME» statusname=er.sap${SAPSYSTEMNAME}_${INSTANCE_NAME}

# License, or (at your option) any later version. #

#---------------------------------------------------#

# This program is distributed in the hope that it # will be useful, but WITHOUT ANY WARRANTY; without

start() {

# even the implied warranty of MERCHANTABILITY or

# check whether I’m the host owning the enserver IP,

# FITNESS FOR A PARTICULAR PURPOSE.

See the GNU

exit if I am The One EN_SERVICE_OWNER=$(ha_service_owner $HA_SERVICE_

# General Public License for more details. #

NAME)

# You should have received a copy of the GNU General # Public License along with this program; if not,

if [ $HOSTNAME = $EN_SERVICE_OWNER ];then echo «Aborted starting $statusname on

# write to the Free Software Foundation, Inc., # 59 Temple Place, Suite 330, Boston, MA

$HOSTNAME:»

02111-1307

echo -n «

# USA

I’m owning cluster service

$HA_SERVICE_NAME»

# # Authors:

Nils Philippsen

echo_failure

#

Florenz Kley

echo



return -1

# # Source function library.

else

. /etc/rc.d/init.d/functions . /etc/init.d/sap_rep_enq.functions

#---------------------------------------------------#

/bin/true

#

Right Ho, Jeeves

fi

# check whether enrepserver is already running here,

# Configure these parameters to match your system

exit if yes

#

local ENREP_STATUS

SAPSYSTEMNAME=RAC

status $statusname

INSTANCE=R

ENREP_STATUS=$?

SAPSYSTEM=02 SIDADM=racadm

if [ $ENREP_STATUS -eq 0 ];then

HOST1=ls3219

echo «Aborted starting $statusname on $HOSTNAME:»

HOST2=ls3220

echo -n «$statusname already running here» #---------------------------------------------------#

echo_failure

# try not to mess with these parameters

echo

February 2006

Reprinted from Dell Power Solutions, February 2006. Copyright © 2006 Dell Inc. All rights reserved.

DELL POWER SOLUTIONS

10

ONLINE-EXTRA CONTENT

Configuring a Highly Available Linux Cluster for SAP Services, continued

RETVAL=$?

return -1 else

echo

/bin/true

#

Much Obliged, Jeeves

rm -f /var/lock/subsys/$prog

fi

rm -f /var/run/${statusname}.pid return $RETVAL

# check whether enrepserver is running on other host. if yes, stop it.

} # END stop() {

local ENREP_STATUS_OTHER service_other_host $prog status

RETVAL=0

ENREP_STATUS_OTHER=$? case «$1» in if [ $ENREP_STATUS_OTHER -eq 3 ];then # stopped. /bin/true

start) start

# How Right You Are, Jeeves

else

RETVAL=$? ;;

service_other_host $prog stop fi

stop) stop

# now start enrepserver locally daemon su - -c «source\ $DIR_PROFILE/sapenv_

RETVAL=$? ;;

${INSTANCE_NAME}.sh;$START_CMD\ pf=$START_ PROFILE» «$SIDADM»

status)

RETVAL=$?

status $statusname

if [ $RETVAL -eq 0 ];then touch /var/lock/subsys/$prog echo `pidof $statusname` >/var/run/ ${statusname}.pid echo

RETVAL=$? ;; restart) stop start RETVAL=$?

else echo «something bad happened while running $START_CMD pf=$START_PROFILE» return $RETVAL

;; *) echo $»Usage: $0 {start|stop|restart|condrestart|

fi

status}» exit 1

} # END start() {

esac

stop() {

exit $RETVAL

echo -n $»Stopping $progname: « daemon su - -c «source\ $DIR_PROFILE/ env_${INSTANCE_NAME}.sh;${DIR_WORK}/kill.sap» «$SIDADM»

until is_stopped;do /bin/sleep 2 done

February 2006

Reprinted from Dell Power Solutions, February 2006. Copyright © 2006 Dell Inc. All rights reserved.

DELL POWER SOLUTIONS

11