Solved

stop/start mq environment

Posted on 2009-05-10
7
4,917 Views
Last Modified: 2013-12-11
what are the best practices to stop/start mq environment.
what needs to be stopped/started first - QM, channel or listener or anything else ?
what happens to messages that are in flight during stop process?
please provide the answer for both clustered and none-clustered environments.
thanks
0
Comment
Question by:wasadmin770
  • 5
  • 2
7 Comments
 
LVL 41

Expert Comment

by:HonorGod
ID: 24356195
Q: What are the best practices to for stopping/starting an MQ environment?
A: 1. Stop all WebSphere Application Server application on the machine(s) and any applications accessing remote resources.
    2. End all MQ activity:
        - Log in as a user authorized in the mqm group
        - Use the dspmq command to display the state of all the queue managers on the system.
        - Use the endmqm command to stop all running queue managers.
        - Stop any listeners associated with the queue managers, using the command:
           * Use "endmqlsr -m QMgrName"
           * To check that you have stopped all necessary WebSphere MQ activity, type:
             => ps -ef | grep mq
           * Check that there are no processes listed that are running command lines beginning amq or runmq. Ignore any that start with amqi.

I'm pretty sure that the stopping order is documented here:
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=/com.ibm.mq.amq1ac.doc/lq10880_.htm

For starting, use the reverse process.  i.e., start MQ, and then WebSphere and other applications

Start command: strmqm QMgrName

It is strongly encouraged to use the MQ Listeners as objects inside the QMgr (this was introduced in V6)

Here is the WebSphere MQ V6 Fundamentals document
http://www.redbooks.ibm.com/abstracts/SG247128.html?Open

See page 269.
1. Create a listener that is started and stopped automatically with the queue
manager by issuing the following MQSC command against host1/echo.hub:
DEFINE LISTENER('LISTENER.TCP') +
TRPTYPE(TCP) PORT(9001) CONTROL(QMGR) +
DESCR('TCP/IP Listener for queue manager')
2. Start the listener using the following MQSC command:
START LISTENER('LISTENER.TCP')

For MQ clustered environments, first stop the Partial repositories, then the Full ones.

Q: What about inflight messages?
A: If the queue manager is asked "nicely" to stop while there are inflight transactions, then the queue manager will NOT stop until the transaction is rolled back or committed.
However if the queue manager is FORCED to stop, then the inflight transactions will be rolled back and this information will be in the MQ recovery logs.

Depending on how the queue manager was forced to stop, then during the restart, the queue manager will try to recover from the recovery logs. It will not begin the transaction that was rolled back.

Hopefully this helps.
0
 

Author Comment

by:wasadmin770
ID: 24366870
please elaborate more on what you mean by "if the queue manager is asked "nicely" to stop" and
"if the queue manager is FORCED to stop". which commands you meant?
also what about stopping/starting channels?
thanks
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 24366939
A"nice" stop is one where the queue manager is given time to deal with the pending operations.

A "hard" or "forced" stop basically says "stop, right now!  I don't care what you are in the middle of, just stop it!".

ok?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:wasadmin770
ID: 24370873

i understand the differerence. the question was - what is the actuall syntax for these 2
approaches.
also do i need to stop/start channels as well?
thanks
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 24371215
Ah, sorry for the misunderstanding... I'll have to check on that tomorrow, and get back to you.
0
 
LVL 41

Accepted Solution

by:
HonorGod earned 500 total points
ID: 24373372
To stop a QueueManager, use the endmqm command.

http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.amqzag.doc/fa15800_.htm

The text from which states:

Syntax:

endmqm [option] QueueName

Options:
  -c = controlled (default)
         This is the "nice" version of the stop.  The queue manager is stopped only after all applications have disconnected.

  -w = wait
         This is another "nice" shutdown.  Control is returned only after the queue manager is stopped.

  -i = immediate
        The queue manager stops after it has completed all the MQI calls currently being processed. Any MQI requests issued after the command has been issued fail. Any incomplete units of work are rolled back when the queue manager is next started.

  -p = preemptive
         Warning: Use this type of shutdown only in exceptional circumstances.
         For example, when a queue manager does not stop as a result of a normal endmqm command.

The queue manager might stop without waiting for applications to disconnect or for MQI calls to complete. This can give unpredictable results for WebSphere® MQ applications. The shutdown mode is set to immediate shutdown. If the queue manager has not stopped after a few seconds, the shutdown mode is escalated, and all remaining queue manager processes are stopped.

The effect on any client applications connected through a server-connection channel is equivalent to a STOP CHANNEL command issued in TERMINATE mode.
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 24380287
Thanks for the grade & points

Good luck & have a great day
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

I previously wrote an article addressing the use of UBCD4WIN and SARDU. All are great, but I have always been an advocate of SARDU. Recently it was suggested that I go back and take a look at Easy2Boot in comparison.
A list of useful business intelligence software.
This video demonstrates basic masking and how to edit the mask to reveal the desired image.
This video will demonstrate how to find the puppet warp tool from the edit menu and where to put the points to edit.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now