ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Installation/Configuration Support » Script for ending qmgr in a clean way (for HA purposes)

Post new topic  Reply to topic
 Script for ending qmgr in a clean way (for HA purposes) « View previous topic :: View next topic » 
Author Message
eltehaem
PostPosted: Mon Apr 28, 2008 1:30 am    Post subject: Script for ending qmgr in a clean way (for HA purposes) Reply with quote

Newbie

Joined: 24 Apr 2008
Posts: 1

Hi,

I've configured HA for MQ as described in "High-availability middleware on Linux" article (http://www.ibm.com/developerworks/linux/library/l-halinux2/). But I have an issue with this configuration. When I turn hearbeat off on primary node, it ends qmgr and than gives up shared disk. But I've noticed that not all MQ processes are ended:

Code:

mqm       7224     1  0 Apr24 ?        00:00:01 amqzxma0 -m QMGR
mqm       7225  7224  0 Apr24 ?        00:00:00 amqzxma0 -m QMGR
mqm       7227  7225  0 Apr24 ?        00:00:00 amqzxma0 -m QMGR
mqm       7229  7225  0 Apr24 ?        00:00:00 amqzxma0 -m QMGR
mqm       7230  7225  0 Apr24 ?        00:00:00 amqzxma0 -m QMGR
mqm       7236  7224  0 Apr24 ?        00:00:00 [amqhasmx] <defunct>
mqm       7240  7224  0 Apr24 ?        00:00:00 amqzllp0 -mQMGR ?
mqm       7241  7240  0 Apr24 ?        00:00:00 amqzllp0 -mQMGR ?
mqm       7243  7241  0 Apr24 ?        00:00:00 amqzllp0 -mQMGR ?
mqm       7244  7241  0 Apr24 ?        00:00:00 amqzllp0 -mQMGR ?
mqm      29584     1  0 10:06 ?        00:00:00 endmqm -w QMGR
mqm      29586 29584  0 10:06 ?        00:00:00 endmqm -w QMGR
mqm      29588 29586  0 10:06 ?        00:00:00 endmqm -w QMGR
mqm      29589 29586  0 10:06 ?        00:00:00 endmqm -w QMGR


And then, when I turn heartbeat on again, qmgr fails to start due to these hanging processes. I believe that the cause is in script which ends qmgr:

Code:

echo ending $qmgr
killproc runmqlsr
su - mqm -c "endmqm -i $qmgr &"
sleep 30


The script puts endmqm command in background and waits only thirty seconds. Then the script ends, and hearbeat gives up shared disk. But endmqm command didn't end during these thirty minutes, and hangs because it could not write anything to disk.

Could somebody tell me why author of the article did it this way? Why not use -w switch without putting command into background:

Code:

echo ending $qmgr
killproc runmqlsr
su - mqm "endmqm -w -i $qmgr"


What's the best way to end qmgr in a clean way, and to be assured that the script ends eventually in a limited time?

And why author used "killproc runmqlsr" instead of "endmqlsr"?
Back to top
View user's profile Send private message
KramJ
PostPosted: Mon Apr 28, 2008 8:58 am    Post subject: Reply with quote

Voyager

Joined: 09 Jan 2006
Posts: 80
Location: Atlanta

Here's what we do on our HACMP clusters:

# get queue manager name
qmgrname=`dspmq | awk -F\( {'print $2'} | awk -F\) {'print $1'}`

# stop sender channels
for i in `echo "dis chl(*) chltype(sdr)" | runmqsc $qmgrname| grep CHANNEL|grep -v SYSTEM| awk '{print $1}'`
do
echo "stop $i" | runmqsc
done

# stop receiver channels
for i in `echo "dis chl(*) chltype(rcvr)" | runmqsc $qmgrname| grep CHANNEL|grep -v SYSTEM| awk '{print $1}'`
do
echo "stop $i" | runmqsc $qmgrname
done

#
# Stop MQ processes
#
echo "running endmq"
echo "then sleeping 10 seconds"
endmqm -i $qmgrname
sleep 10


# Kill ipcs threads
ipcs | grep mqm | grep ^m | sed "s/m//g" | awk '{print$1}' > killme
for i in `cat killme `
do
ipcrm -m $i
done
rm killme

ipcs | grep mqm | grep ^s | sed "s/s//g" | awk '{print$1}' > killme
for i in `cat killme `
do
ipcrm -s $i
done
rm killme

exit 0
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Installation/Configuration Support » Script for ending qmgr in a clean way (for HA purposes)
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.