首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >IBM Websphere连接失败

IBM Websphere连接失败
EN

Stack Overflow用户
提问于 2017-02-22 19:31:44
回答 1查看 1.8K关注 0票数 1

我能够使用所有用户帐户从Eclipse Explorer连接到MQ。但是,当我尝试从C客户端使用我的用户帐户('muthu')连接时,它抛出错误"MQCONN ended with reason code 2035“。注意:我能够使用相同的C-Client代码访问MQ,同时以root用户(属于mqm组)的身份运行代码。

我当前的设置是

代码语言:javascript
复制
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中的日志

代码语言:javascript
复制
     ----- 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代码要点:

代码语言:javascript
复制
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上的问题的续篇

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-02-22 23:05:05

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

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

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42390118

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档