on 09-25-2011 2:40 AM
Dear All,
I have installed SAPECC6.0 system on HA Cluster with Oracle as database and Linux Redhat as OS. It works well when I run the scripts
manually,but can't work anyway when add more than one script into the HA Cluster. When I add the only one script into the HA Cluster
I find it runs times and times again and the log shows that the sap service have stared,but I can't visit the server by SAPGUI.
Please advice.
Thanks
Hi,
Hi,
Could you clarify the case, please?
Best regards,
Orkun Gedik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Orkun Gedik,
We write the HA script:starCI \ StarDI \ StopCI \ stop DI, they are content follow as:
The StartCI file content:
########################################################################################
#!/bin/sh
HOSTNAME=`hostname`
sleep 5
if [ "$HOSTNAME" = "plmprd02" ];
then
echo "start DI on plmprd02"
mount -t gfs /dev/vg_app/lv_sapmnt /sapmnt
mount -t gfs /dev/vg_app/lv_trans /usr/sap/trans
mount -t gfs /dev/vg_app/lv_data /oracle
mount -t gfs /dev/vg_app/lv_pld /usr/sap/PLD/
mount -t gfs /dev/vg_app/lv_di /usr/sap/PLD/D00
sleep 10
su - orapld -c "lsnrctl start"
su - pldadm -c "startsap db "
su - pldadm -c "startsap ASCS01 ascspld"
su - pldadm -c "startsap"
else
echo "start CI on plmpro01..."
mount -t gfs /dev/vg_app/lv_trans /usr/sap/trans
mount -t gfs /dev/vg_app/lv_sapmnt /sapmnt
mount -t gfs /dev/vg_app/lv_data /oracle
mount -t gfs /dev/vg_app/lv_pld /usr/sap/PLD
mount -t gfs /dev/vg_app/lv_ci /usr/sap/PLD/DVEBMGS00
su - orapld -c "lsnrctl start"
su - pldadm -c "startsap db "
sleep 5
su - pldadm -c "startsap ASCS01 ascspld"
su - pldadm -c "startsap "
echo "start DI on plmpro02"
rsh plmprd02 -n "su - pldadm -c 'startsap'"
exit 0
fi
exit 0
Edited by: bill yang on Sep 26, 2011 9:09 AM
The StartdI file content:
########################################################################################
#!/bin/sh
SAPNR=00
SAPSID=PLD
SAPINST=D$SAPNR
OUT=/tmp/cluster.out
SAPADM=pldadm
ORAADM=orapld
HOSTNAME=`hostname`
echo "startDialog Instance now ..."
echo `date` >> $OUT
#mount remote filesystem
mount -t gfs /dev/vg_app/lv_trans /usr/sap/trans >> $OUT
mount -t gfs /dev/vg_app/lv_sapmnt /sapmnt >> $OUT
mount -t gfs /dev/vg_app/lv_data /oracle >> $OUT
mount -t gfs /dev/vg_app/lv_pld /usr/sap/PLD >> $OUT
mount -t gfs /dev/vg_app/lv_di /usr/sap/PLD/D00 >> $OUT
su - $SAPADM -c "startsap " >> $OUT
echo "Dialog instance started"
exit 0
the StopCI file content
#######################################################################################
#!/bin/ksh
Description: Use to stop CI
SAPNR=00
DI_SVC=172.26.159.22
SAPSID=PLD
ORASID=PLD
SAPINST=DVEBMGS$SAPNR
OUT=/tmp/hacmp.out
HOSTNAME=`hostname`
echo $HOSTNAME
SAPADM=pldadm
ORAADM=orapld
if [ $HOSTNAME = "plmprd01" ]
then
stop dialog instance on plmpro02
if [ "$(ping -c 2 $DI_SVC | grep transmitted | awk '{print $7}')" == "0%" ]
then
echo "stop dialog instance on plmprd02" >> $OUT
rsh plmprd02 -n "/HAscripts/stopDI.sh"
PSNUM=`rsh plmprd02 -n "ps -ef|grep sap|fgrep -v grep |wc -l"`
echo $PSNUM
while [ $PSNUM -ge 3 ]
do
PSLIST=`rsh plmprd02 -n "ps -ef|grep sap |fgrep -v grep "| awk '{print $2} '`
if [[ -n $ ]] then echo "$" | while read PSID
do
echo $PSID
rsh plmprd02 -n "kill -9 $PSID"
done
fi
PSNUM=`rsh plmprd02 -n "ps -ef|grep sap |fgrep -v grep|wc -l"`
done
rsh plmprd02 -n "umount -f /sapmnt"
rsh plmprd02 -n "umount -f /usr/sap/trans"
else
echo IP Address $DI_SVC is not pingable, then continue ...
fi
fi
#----
Stop R3
Stop saposcol, if running
#----
su - $SAPADM -c "stopsap" >> $OUT
su - $SAPADM -c "stopsap ASCS01 ascspld" >> $OUT
ps -ef | grep saposcol | fgrep -v grep > /dev/null 2>&1
if [ $? = 0 ]
then
su - root -c "/sapmnt/$SAPSID/exe/saposcol -k > /dev/null 2>&1"
fi
#----
Stop all R3 Processes left running
Clean shared memory
Remove Logfiles
Remove Logfiles
#----
ps -ef | grep $SAPINST | fgrep -v grep > /dev/null 2>&1
if [ $? = 0 ];then
SAPSEPID=`ps -ef | grep se.sa[p]"$SAPSID"_$SAPINST | awk '{ print $2 }'`
for i in $SAPSEPID
do
kill -2 $i
done
SAPCOPID=`ps -ef | grep co.sa[p]"$SAPSID"_$SAPINST | awk '{ print $2 }'`
for i in $SACOSPID
do
kill -2 $i
done
SAPDWPID=`ps -ef | grep dw.sa[p]"$SAPSID"_$SAPINST | awk '{ print $2 }'`
for i in $SAPDWPID
do
kill -2 $i
done
SAPMSPID=`ps -ef | grep ms.sa[p]"$SAPSID"_$SAPINST | awk '{ print $2 }'`
for i in $SAPMSPID
do
kill -2 $i
done
SAPPID=`ps -ef | grep START_$SAPINST | fgrep -v grep | awk '{ print $2 }'`
for i in $SAPPID
do
kill -2 $i
done
SAPID=`ps -ef | grep "$SAPSID"_$SAPINST | fgrep -v grep | awk '{ print $2 }'`
for i in $SAPID
do
kill -2 $i
done
fi
#----
Clear shared semaphores/memory
#----
su - $SAPADM -c "/sapmnt/$SAPSID/exe/cleanipc $SAPNR remove" >> $OUT
#----
If existing, remove Collector's logfiles
#----
if [ -f /usr/sap/$SAPSID/$SAPINST/data/rslg* ]
then
/usr/bin/rm /usr/sap/$SAPSID/$SAPINST/data/rslg*
fi
su - $SAPADM -c "stopsap db" >> $OUT
su - $ORAADM -c "lsnrctl stop" >> $OUT
kill -9 $(ps -ef | grep db2 | grep -v 'grep' | awk '{print $2'})
#unmount -f /sapmnt
exit 0
The STOPDI file content:
#######################################################################################
#!/bin/sh
SAPNR=00
SAPSID=PLD
SAPINST=D$SAPNR
OUT=/tmp/hacmp.out
SAPADM=sapadm
ORAADM=orapld
echo "STOP DI NOW ..."
echo `date` >> $OUT
su - $SAPADM -c "stopsap" >> $OUT
su - $SAPADM -c "stopsap ASCS01 ascspld" >> $OUT
echo "DI STOPPED"
ps -ef | grep saposcol | fgrep -v grep > /dev/null 2>&1
if [ $? = 0 ]
then
su - root -c "/sapmnt/$SAPSID/exe/saposcol -k > /dev/null 2>&1"
fi
echo "SAPOSCOL stopped"
#----
Stop all R3 Processes left running
Clean shared memory
Remove Logfiles
Remove Logfiles
#----
ps -ef | grep $SAPINST | fgrep -v grep > /dev/null 2>&1
if [ $? = 0 ];then
SAPSEPID=`ps -ef | grep se.sa[p]"$SAPSID"_$SAPINST | awk '{ print $2 }'`
for i in $SAPSEPID
do
kill -2 $i
done
SAPCOPID=`ps -ef | grep co.sa[p]"$SAPSID"_$SAPINST | awk '{ print $2 }'`
for i in $SACOSPID
do
kill -2 $i
done
SAPDWPID=`ps -ef | grep dw.sa[p]"$SAPSID"_$SAPINST | awk '{ print $2 }'`
for i in $SAPDWPID
do
kill -2 $i
done
SAPMSPID=`ps -ef | grep ms.sa[p]"$SAPSID"_$SAPINST | awk '{ print $2 }'`
for i in $SAPMSPID
do
kill -2 $i
done
SAPPID=`ps -ef | grep START_$SAPINST | fgrep -v grep | awk '{ print $2 }'`
for i in $SAPPID
do
kill -2 $i
done
SAPID=`ps -ef | grep "$SAPSID"_$SAPINST | fgrep -v grep | awk '{ print $2 }'`
for i in $SAPID
do
kill -2 $i
done
fi
#----
Clear shared semaphores/memory
#----
su - $SAPADM -c "/sapmnt/$SAPSID/exe/cleanipc $SAPNR remove" >> $OUT
#----
If existing, remove Collector's logfiles
#----
if [ -f /usr/sap/$SAPSID/$SAPINST/data/rslg* ]
then
rm /usr/sap/$SAPSID/$SAPINST/data/rslg*
fi
#umount the nfs filesystem
umount -f /sapmnt >> $OUT
umount -f /usr/sap/trans >> $OUT
exit 0
-
The HA structure have two server,when one server down,if we mannul run these script,all service can change to other server,But when we put the script file to HA Dir,when one server down,System can run the script file,But the service cann't change to other server,can you help me?
Hi,
Check the document, below;
http://publibfp.dhe.ibm.com/epubs/pdf/bl1pdg10.pdf
Best regards,
Orkun Gedik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.