Ibm mq IBM Websphere连接失败

Ibm mq IBM Websphere连接失败,ibm-mq,Ibm Mq,我能够使用所有用户帐户从Eclipse Explorer连接到MQ。但是,当我尝试使用我的useraccount('muthu')从C客户机连接时,它抛出错误“MQCONN结束,原因代码为2035”。注意:在以根用户(mqm组的一部分)身份运行代码时,我能够使用相同的C客户机代码访问MQ 我当前的设置是 ALTER QMGR PSNPRES(SAFE) ALTER QMGR PSMODE (ENABLED) ALTER QMGR CHLAUTH(DISABLED) SET CHLAUTH(*)

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

我当前的设置是

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;
   }
.................
有什么想法吗


这是我在

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


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

您连接的是哪个c客户端?一个示例应用程序还是您自己的?如果它是一个示例应用程序,您将设置哪些环境变量/传递哪些参数?您所显示的日志,您能检查一下吗?您已经从队列管理器日志(/var/mqm/qmgrs//errors/AMQERR01.log)中给出了完整的日志。我希望看到更多的日志消息与AMQ9557错误一起出现。刚刚将日志中的行添加到AMQ9557之前。这就是你所指的吗?我使用的是安装时附带的一个示例发布/订阅c程序,只是做了一些小的调整。到底是哪个示例发布/订阅程序?amqspuba.c?amqssuba.c?我实际上是在上一个日志条目之后。例如,我刚刚在队列管理器日志中快速重新创建了一个AMQ9557错误,在该错误消息之前是另一个错误消息(在我的例子中是AMQ8075),详细说明了引发AMQ9557错误的原因。我没有看到AMQ8075的条目。我进行了测试。我已经更新了新的日志。主要错误似乎是“初始化用户ID‘sampleuser’的调用失败,代码为2,原因为2035。”,日志中显示的其余错误在几秒钟后写入。我现在使用amqspuba.c进行测试。在顶部的MQSC中,您定义了一个名为
SYSTEM.ADMIN.SVRCONN
的通道,但您的错误日志显示一个名为
SYSTEM.DEF.SVRCONN
的通道正在关闭。对吗?