Solved

stop/start mq environment

Posted on 2009-05-10
7
5,052 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
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Today companies are subjected to more-and-more data, and it won't stop any time soon.  But there are obvious opportunities for reducing data, particularly data duplicated among companies.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The viewer will learn how to create multiple layers to apply various filters and how to delete areas from each layer’s filter.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

840 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