【问题标题】:IBM Websphere connection failureIBM Websphere 连接失败
【发布时间】:2020-04-17 03:04:03
【问题描述】:

我可以使用所有用户帐户从 Eclipse Explorer 连接到 MQ。但是当我尝试使用我的用户帐户('muthu')从 C 客户端连接时,它会抛出错误“MQCONN 以原因代码 2035 结束”。注意:我可以使用相同的 C-Client 代码访问 MQ,同时以 root 用户身份运行代码(这是 mqm 组的一部分)。

我目前的设置是

ALTER QMGR PSNPRES(SAFE)
ALTER QMGR PSMODE (ENABLED)
ALTER QMGR CHLAUTH(DISABLED)
SET CHLAUTH(*) TYPE(BLOCKUSER) USERLIST('*NOACCESS')
DEFINE CHANNEL(SYSTEM.ADMIN.SVRCONN) CHLTYPE(SVRCONN) MCAUSER('sampleuser') REPLACE
ALTER AUTHINFO(SYSTEM.DEFAULT.AUTHINFO.IDPWOS) AUTHTYPE(IDPWOS) CHCKCLNT(OPTIONAL)
REFRESH SECURITY TYPE(CONNAUTH)

以下是在 AMQERR01.LOG 中找到的日志

     ----- cmqxrsrv.c : 2363 -------------------------------------------------------
02/22/17 13:51:13 - Process(353.6) User(root) Program(amqrmppa)
                    Host(ec060cda2b57) Installation(Installation1)
                    VRMF(9.0.0.0) QMgr(TMVDEVQM)

AMQ9788: Slow DNS lookup for address '172.17.0.1'.

EXPLANATION:
An attempt to resolve address '172.17.0.1' using the 'getnameinfo' function
call took 20 seconds to complete. This might indicate a problem with the DNS
configuration.
ACTION:
Ensure that DNS is correctly configured on the local system. 

If the address was an IP address then the slow operation was a reverse DNS
lookup. Some DNS configurations are not capable of reverse DNS lookups and some
IP addresses have no valid reverse DNS entries. If the problem persists,
consider disabling reverse DNS lookups until the issue with the DNS can be
resolved.
----- amqcrhna.c : 794 --------------------------------------------------------
02/22/17 13:51:33 - Process(353.6) User(root) Program(amqrmppa)
                    Host(ec060cda2b57) Installation(Installation1)
                    VRMF(9.0.0.0) QMgr(TMVDEVQM)

AMQ9788: Slow DNS lookup for address '172.17.0.1'.

EXPLANATION:
An attempt to resolve address '172.17.0.1' using the 'getnameinfo' function
call took 20 seconds to complete. This might indicate a problem with the DNS
configuration.
ACTION:
Ensure that DNS is correctly configured on the local system. 

If the address was an IP address then the slow operation was a reverse DNS
lookup. Some DNS configurations are not capable of reverse DNS lookups and some
IP addresses have no valid reverse DNS entries. If the problem persists,
consider disabling reverse DNS lookups until the issue with the DNS can be
resolved.
----- amqcrhna.c : 794 --------------------------------------------------------
02/22/17 13:51:33 - Process(353.6) User(root) Program(amqrmppa)
                    Host(ec060cda2b57) Installation(Installation1)
                    VRMF(9.0.0.0) QMgr(TMVDEVQM)

AMQ9209: Connection to host '172.17.0.1' for channel 'SYSTEM.DEF.SVRCONN'
closed.

EXPLANATION:
An error occurred receiving data from '172.17.0.1' over TCP/IP.  The connection
to the remote host has unexpectedly terminated. 

The channel name is 'SYSTEM.DEF.SVRCONN'; in some cases it cannot be determined
and so is shown as '????'.
ACTION:
Tell the systems administrator.

C 代码要点:

int pub(char *topic_name, char *queue_manager_name, char *message)
 {
   /*  Declare file and character for sample input                   */
   FILE *fp;

   /*   Declare MQI structures needed                                */
   MQOD     od = {MQOD_DEFAULT};    /* Object Descriptor             */
   MQMD     md = {MQMD_DEFAULT};    /* Message Descriptor            */
   MQPMO   pmo = {MQPMO_DEFAULT};   /* put message options           */
      /** note, sample uses defaults where it can **/

   MQHCONN  Hcon;                   /* connection handle             */
   MQHOBJ   Hobj;                   /* object handle                 */
   MQLONG   CompCode;               /* completion code               */
   MQLONG   OpenCode;               /* MQOPEN completion code        */
   MQLONG   Reason;                 /* reason code                   */
   MQLONG   CReason;                /* reason code for MQCONN        */
   MQLONG   messlen;                /* message length                */
   char     buffer[100];            /* message buffer                */
   char     QMName[50];             /* queue manager name            */

   QMName[0] = 0;    /* default */
   strncpy(QMName, queue_manager_name, MQ_Q_MGR_NAME_LENGTH);

   pmo.Options = MQPMO_FAIL_IF_QUIESCING
                 | MQPMO_NO_SYNCPOINT;

   /******************************************************************/
   /*                                                                */
   /*   Connect to queue manager                                     */
   /*                                                                */
   /******************************************************************/
   MQCONN(QMName,                  /* queue manager                  */
          &Hcon,                   /* connection handle              */
          &CompCode,               /* completion code                */
          &CReason);               /* reason code                    */

   /* report reason and stop if it failed     */
   if (CompCode == MQCC_FAILED)
   {
     printf("MQCONN ended with reason code %d\n", CReason);
     return (int)CReason;
   }
.................

任何想法。 ?

这是我在Provide anonymous access to IBM WebSphere MQ 的问题的延续

【问题讨论】:

  • 你连接的是什么c客户端?示例应用程序之一还是您自己的?如果它是一个示例应用程序,您正在设置哪个环境变量以及您传递的参数是什么?您显示的日志,您能否检查一下您是否已从队列管理器日志 (/var/mqm/qmgrs//errors/AMQERR01.LOG) 中提供了整个日志,我预计会再看到一个日志出现 AMQ9557 错误的消息。
  • 刚刚将日志中的行添加到 AMQ9557 之前。这就是你所指的吗?我正在使用安装附带的示例 pub/sub c 程序之一,稍作调整。
  • 究竟是哪个示例发布/订阅程序? amqspuba.c? amqssuba.c?我实际上是在上一个日志条目之后。例如,我刚刚在队列管理器日志中快速重新创建了 AMQ9557 错误,在该错误消息之前是另一条错误消息(在我的情况下为 AMQ8075),详细说明了引发 AMQ9557 错误的原因。
  • 我没有看到 AMQ8075 的条目。我跑了测试增益。我已经更新了新日志。主要错误似乎是“使用 CompCode 2 和原因 2035 初始化用户 ID 'sampleuser' 的调用失败。”,日志中显示的其余错误将在几秒钟后写入。我现在正在使用 amqspuba.c 进行测试。
  • 在顶部的 MQSC 中,您定义了一个名为 SYSTEM.ADMIN.SVRCONN 的通道,但您的错误日志显示一个名为 SYSTEM.DEF.SVRCONN 的通道正在关闭。对吗?

标签: ibm-mq


【解决方案1】:

查看您的 MQSC 代码,我看到您定义了一个名为 SYSTEM.ADMIN.SVRCONN 的频道,但是我在日志中看到一个名为 SYSTEM.DEF.SVRCONN 的频道正在关闭(在连接失败后)。

鉴于您发布的示例程序未设置 MQCNO 结构,这是以编程方式传递通道名称的方式,并且您没有提到 CCDT(这是另一种方式)我怀疑您的 MQSERVER 环境变量不正确.

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-02-01
    • 1970-01-01
    • 2011-06-16
    • 2017-09-24
    • 2021-08-01
    • 1970-01-01
    • 2018-07-07
    • 1970-01-01
    相关资源
    最近更新 更多