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 » General IBM MQ Support » How to test which multi instance QM node is active?

Post new topic  Reply to topic
 How to test which multi instance QM node is active? « View previous topic :: View next topic » 
Author Message
pauline_coffey
PostPosted: Tue Nov 12, 2024 8:51 am    Post subject: How to test which multi instance QM node is active? Reply with quote

Novice

Joined: 05 Dec 2002
Posts: 15
Location: Dublin, Ireland

Hi,

I have a simple script to backup my various QMs (just config data) but on a multi-instance QM, how can I tell on which node my QM is running/active? On my MSCS or PowerHA managed clusters I just rely on dspmq to fail on the inactive nodes but that obviously won't work on the multi-instance QMs.

Thanks,
Pauline
Back to top
View user's profile Send private message
bruce2359
PostPosted: Fri Nov 15, 2024 10:33 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

According to https://www.ibm.com/docs/en/ibm-mq/9.2?topic=reference-dspmq-display-queue-managers the -x switch.
_________________
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
View user's profile Send private message
pauline_coffey
PostPosted: Fri Nov 15, 2024 10:37 am    Post subject: Reply with quote

Novice

Joined: 05 Dec 2002
Posts: 15
Location: Dublin, Ireland

Thanks, the thing is dspmq succeeds (rc=0) on both nodes with or without the -x switch. I think I will have to beef up my script in some other way rather than rely on an MQ command to fail to infer which node is active (and so which one to backup).
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sat Nov 16, 2024 9:58 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

pauline_coffey wrote:
Thanks, the thing is dspmq succeeds (rc=0) on both nodes with or without the -x switch. I think I will have to beef up my script in some other way rather than rely on an MQ command to fail to infer which node is active (and so which one to backup).

The output of dspmq -x is quite clear on that. Filter on running and check whether the node given is the current node...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
pauline_coffey
PostPosted: Sun Nov 17, 2024 12:50 am    Post subject: Reply with quote

Novice

Joined: 05 Dec 2002
Posts: 15
Location: Dublin, Ireland

Yes, thanks. I am using a rather limited Windows shell but will figure something out.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Sun Nov 17, 2024 2:42 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

pauline_coffey wrote:
Yes, thanks. I am using a rather limited Windows shell but will figure something out.

Not sure what this means? Do you get an error of some kind? Issuing control commands requires mqm or equivalent authority.
_________________
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
View user's profile Send private message
pauline_coffey
PostPosted: Mon Nov 18, 2024 3:08 am    Post subject: Reply with quote

Novice

Joined: 05 Dec 2002
Posts: 15
Location: Dublin, Ireland

Hi, yes, on all my non-MQ managed HA pairs, dspmq fails (rc<>0) on the passive node whereas on an MQ managed HA pair, dspmq will always be successful (rc=0). As I say, I will try something else rather than rely on an MQ command to fail.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Mon Nov 18, 2024 1:04 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

pauline_coffey wrote:
Hi, yes, on all my non-MQ managed HA pairs, dspmq fails (rc<>0) on the passive node whereas on an MQ managed HA pair, dspmq will always be successful (rc=0). As I say, I will try something else rather than rely on an MQ command to fail.

Exactly what command did you enter? Please include the complete response to your command, not just the return code.
Exactly what non-zero return code did you receive?
This https://www.ibm.com/docs/en/ibm-mq/9.2?topic=reference-dspmq-display-queue-managers lists possible return codes.

Return code Description

0 Command completed normally
5 Queue manager running
36 Invalid arguments supplied
58 Inconsistent use of installations detected
71 Unexpected error
72 Queue manager name error
_________________
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
View user's profile Send private message
gbaddeley
PostPosted: Mon Nov 18, 2024 4:30 pm    Post subject: Reply with quote

Jedi Knight

Joined: 25 Mar 2003
Posts: 2538
Location: Melbourne, Australia

pauline_coffey wrote:
Thanks, the thing is dspmq succeeds (rc=0) on both nodes with or without the -x switch. I think I will have to beef up my script in some other way rather than rely on an MQ command to fail to infer which node is active (and so which one to backup).

You should rely on IBM MQ commands. Custom script code might fail at some point in the future when IBM decide to change how things work under the covers, whereas the behavior of a MQ command will be consistent and documented.
_________________
Glenn
Back to top
View user's profile Send private message
pauline_coffey
PostPosted: Tue Nov 19, 2024 1:11 am    Post subject: Reply with quote

Novice

Joined: 05 Dec 2002
Posts: 15
Location: Dublin, Ireland

Hi Bruce,
I'm now happy to solve myself, but just to show you what I mean:

C:\windows\system32>dspmq -x -m QM01
QMNAME(QM01) STATUS(Running as standby)
INSTANCE(AZ01) MODE(Active)
INSTANCE(AZ02) MODE(Standby)

C:\windows\system32>echo %errorlevel%
0

C:\windows\system32>dspmq -m QM01
QMNAME(QM01) STATUS(Running as standby)

C:\windows\system32>echo %errorlevel%
0

C:\windows\system32>dspmq -x -m QM02
AMQ7048E: The queue manager name is either not valid or not known.

C:\windows\system32>echo %errorlevel%
72

These rc's are perfectly reasonable, but I was just hoping for an easy solution to determine which was the active MQ node in an MQ managed cluster from a primitive Windows batch file - on MSCS managed nodes, dspmq will fail on the passive node.

Thanks for the responses in any case.
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Tue Nov 19, 2024 8:35 pm    Post subject: Reply with quote

Jedi Knight

Joined: 25 Mar 2003
Posts: 2538
Location: Melbourne, Australia

I don't have any MIQM to try this out.
Does the -a parameter assist?
The errorlevel should be 5 if the qmgr is running locally, or 0 if not running locally.
Without -a, it returns errorlevel 0 in both cases.

Not sure if a MIQM "running as standby" is treated as a locally running qmgr.

Refer to the Return Codes on https://www.ibm.com/docs/en/ibm-mq/9.4?topic=reference-dspmq-display-queue-managers
_________________
Glenn
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 » General IBM MQ Support » How to test which multi instance QM node is active?
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.