Author |
Message
|
paustin_ours |
Posted: Wed Oct 30, 2019 11:10 am Post subject: script before qmgr start |
|
|
Yatiri
Joined: 19 May 2004 Posts: 667 Location: columbus,oh
|
Is there a way to call a script before a queue manager starts?
would like to implement multi instance queue managers but need to have a script run on a server the qmgr switches over to and before the queue manager starts. Similarly if it fails on the running server, before switching i would like a dscript run on the current server before switching and also on the new server before qmgr starts up. Is this possible? |
|
Back to top |
|
|
bruce2359 |
Posted: Wed Oct 30, 2019 11:26 am Post subject: |
|
|
Poobah
Joined: 05 Jan 2008 Posts: 9442 Location: US: west coast, almost. Otherwise, enroute.
|
Yes, you can issue 'strmqm' command from a script. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
|
PeterPotkay |
Posted: Wed Oct 30, 2019 4:50 pm Post subject: |
|
|
Poobah
Joined: 15 May 2001 Posts: 7717
|
Internal MQ processes are deciding when to switch a multi instance QM from one node to another when there is an unplanned reason to fail over. The unplanned failover occurs without anyone calling strmqm. I don't know how you would guarantee your script ran before this automated outside-of-your-control failover occurred.
What does your script do? _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
|
HubertKleinmanns |
Posted: Thu Oct 31, 2019 1:18 am Post subject: Re: script before qmgr start |
|
|
Shaman
Joined: 24 Feb 2004 Posts: 732 Location: Germany
|
paustin_ours wrote: |
Is there a way to call a script before a queue manager starts?
would like to implement multi instance queue managers but need to have a script run on a server the qmgr switches over to and before the queue manager starts. Similarly if it fails on the running server, before switching i would like a dscript run on the current server before switching and also on the new server before qmgr starts up. Is this possible? |
This normally is called HA (e. g. PowerHA for AIX). _________________ Regards
Hubert |
|
Back to top |
|
|
fjb_saper |
Posted: Thu Oct 31, 2019 8:52 pm Post subject: |
|
|
Grand High Poobah
Joined: 18 Nov 2003 Posts: 20729 Location: LI,NY
|
Have you looked at running it as a queue manager service, starting at queue manager start and setting a different script for qmgr shutdown / service shutdown... _________________ MQ & Broker admin |
|
Back to top |
|
|
HubertKleinmanns |
Posted: Thu Oct 31, 2019 11:45 pm Post subject: |
|
|
Shaman
Joined: 24 Feb 2004 Posts: 732 Location: Germany
|
First question: Which platform ?
Second question: What shall your script do (Peter asked this already)?
MQ controls the take-over of a multi-instance QMgr by checking some file locks - no script is involved. As soon as the standby-instance recognizes an unlocking of this file, it starts the QMgr. No chance to put a script into the flow.
But may be you could create a MQ service object of type COMMAND, which runs your script, like this:
Code: |
DEFINE SERVICE('<your_name>') SERVTYPE(COMMAND) +
CONTROL(STARTONLY) STARTCMD('<your_script>') +
STARTARG('<script_args>') STDOUT('...') STDERR('...') |
This script wouldn't run before the QMgr starts, but immediately after the QMgr came up.
If you have to check some things, before the QMgr is started, you cannot use multi-instance QMgrs. In this case you have to use HA (or some own scripts around, which nearly do the same). _________________ Regards
Hubert |
|
Back to top |
|
|
|