如何使用可编程命令格式获取MQ集群信息? [英] How to get MQ Cluster information using Programmable Command Format?
问题描述
我有一个mq集群设置,其中有几个队列管理器,一些是完整的存储库,有些是部分存储库.
完整的存储库应该保存有关整个集群的信息(元数据?).
部分存储库将保存有关集群的一些信息.
如何使用可编程命令格式收集有关整个集群的信息?
有关主机,队列管理器,完整和部分存储库,集群队列等的信息.
I have a mq cluster setup that has a few queue managers, some are full repositories and some are partial repositories.
A full repository is supposed to hold information(meta data?) about the entire cluster.
A partial repository will hold some information about the cluster.
How do I gather information about the entire cluster using Programmable Command Format?
Information about hosts, queue managers, full and partial repositories, cluster queues etc....
更新1
我已经尝试了以下代码,但这不会返回群集信息.
Update 1
I have tried the following code but this does not return cluster information.
PCFMessageAgent agent = new PCFMessageAgent(queueManager);
agent.setCheckResponses(false);
PCFMessage[] responses;
PCFMessage request = new PCFMessage(MQConstants.MQCMD_INQUIRE_CLUSTER_Q_MGR);
request.addParameter(MQConstants.MQCA_CLUSTER_Q_MGR_NAME, queueManager);
responses = agent.send(request);
String clusterName = (String)responses[0].getParameterValue(MQConstants.MQCA_CLUSTER_NAME);
String clusterInfo = (String)responses[0].getParameterValue(MQConstants.MQIACF_CLUSTER_INFO);
logger.info("Cluster Name [" + clusterName + "]");
logger.info("Cluster Information [" + clusterInfo + "]");
最后一行显示空值.
更新2
以下答案表明MQCMD_INQUIRE_CLUSTER_Q_MGR
等效于runmqsc DISPLAY CLUSQMGR(*)
命令.以下是该命令的输出
Update 2
The answer below suggests that MQCMD_INQUIRE_CLUSTER_Q_MGR
is equivalent to runmqsc DISPLAY CLUSQMGR(*)
command. Following is the output from this command
display clusqmgr(*)
4 : display clusqmgr(*)
AMQ8441: Display Cluster Queue Manager details.
CLUSQMGR(QM_FR1) CHANNEL(TO.QM_FR1)
CLUSTER(CLUSTER1)
AMQ8441: Display Cluster Queue Manager details.
CLUSQMGR(QM_FR2) CHANNEL(TO.QM_FR2)
CLUSTER(CLUSTER1)
AMQ8441: Display Cluster Queue Manager details.
CLUSQMGR(QM_PR1) CHANNEL(TO.QM_PR1)
CLUSTER(CLUSTER1)
AMQ8441: Display Cluster Queue Manager details.
CLUSQMGR(QM_PR2) CHANNEL(TO.QM_PR2)
CLUSTER(CLUSTER1)
AMQ8441: Display Cluster Queue Manager details.
CLUSQMGR(QM_PR3) CHANNEL(TO.QM_PR3)
CLUSTER(CLUSTER1)
AMQ8441: Display Cluster Queue Manager details.
CLUSQMGR(QM_PR3) CHANNEL(TO.QM_PR3)
CLUSTER(CLUSTER1)
我期望我提供的代码中PCF会有类似的响应,但是我没有得到此信息.
所以问题是
如何使用PCF获取此信息?以上输出是针对完整的存储库队列管理器的.
I was expecting a similar response with PCF in the code i have supplied, but i don't get this information.
So the question is
How do I get this information using PCF? The above output is for a full repository queue manager.
推荐答案
使用以下PCF命令
- 查询集群队列管理器( MQCMD_INQUIRE_Q ),与MQSC命令
DISPLAY QUEUE(*) CLUSINFO
等效.请注意,MQIACF_CLUSTER_INFO参数是此命令的输入限定符,它将导致集群队列以及本地队列作为答案返回.
- Inquire Cluster Queue Manager (MQCMD_INQUIRE_CLUSTER_Q_MGR) which is the equivalent of the MQSC command
DISPLAY CLUSQMGR
. In the linked page, you can see all the possible output parameters listed in the section headed withClusterQMgrAttrs
. You can remove the line in your code that is trying to retrieve the value of the MQIACF_CLUSTER_INFO - an INPUT-ONLY parameter - and replace that line with any one of the parameters listed in that section to retrieve whatever information it is that you want about this cluster queue manager. - Inquire Queue (MQCMD_INQUIRE_Q) with the MQIACF_CLUSTER_INFO parameter which is the equivalent of the MQSC command
DISPLAY QUEUE(*) CLUSINFO
. Please note, the MQIACF_CLUSTER_INFO parameter is an input qualifier to this command that causes cluster queues as well as local queues to be returned as answers.
您正确地注意到,只有完整的存储库队列管理器才知道有关集群的所有信息,因此您需要向该队列管理器进行查询以获取全部信息.
As you correctly note, only the full repository queue manager knows everything about a cluster, so you need to make your inquiries against that queue manager in order to get the full picture.
这篇关于如何使用可编程命令格式获取MQ集群信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!