Solved

stop/start mq environment

Posted on 2009-05-10
7
4,951 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
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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…
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Viewers will learn how to use the Hootsuite Dashboard.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

911 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

20 Experts available now in Live!

Get 1:1 Help Now