配置 MQIPT 集群支持

在此场景中,可以设置集群环境。

开始之前

  • 在开始使用此方案之前,请确保您已完成 MQ 中列出的前提任务。
  • IBM MQ 服务器伦敦:
    • 定义名为 LONDON 的队列管理器。
    • 定义名为 MQIPT.CONN.CHANNEL 的服务器连接通道。
    • 在端口 1414 上启动针对 LONDON 的 TCP/IP 侦听器。
    • 在队列管理器中启用 SOCKS。
  • IBM MQ 服务器 NEWNYE 上:
    • 定义名为 NEWYORK 的队列管理器。
    • 定义名为 MQIPT.CONN.CHANNEL 的服务器连接通道。
    • 在端口 1414 上启动针对 NEWYORK 的 TCP/IP 侦听器。
    • 在队列管理器中启用 SOCKS。
注: 对于 SOCKS-启用队列管理器,请启用整个计算机或仅启用 IBM MQ 服务器应用程序。 按以下方式配置 SOCKS 客户机:
  • 将客户机作为 SOCKS 代理指向 MQIPT
  • 启用 SOCKS V5 支持。
  • 禁用用户认证。
  • 仅与 MQIPT建立远程连接。

关于本任务

图 1。 集群网络图
请参阅文本。

此图显示从 IBM MQ 客户机到 MQIPTIBM MQ 服务器的连接。

在同一台计算机上,只能有一个应用程序侦听单个给定端口。 如果端口 1414 已在使用中,请选择空闲的端口并将以下示例中的端口值替换为此端口。

这样,便可以通过将消息放入 LONDON 服务器上的本地队列中并从 NEWYORK 服务器检索该消息,来测试队列管理器之间的路径。

过程

要配置 MQIPT 集群支持,请完成以下步骤:

  1. 设置 LONDON 服务器。
    打开命令提示符并输入以下命令:
    runmqsc
    DEFINE CHANNEL(TO.LONDON) +
           CHLTYPE(CLUSRCVR) TRPTYPE(TCP) +
           CLUSTER(INVENTORY) +
           CONNAME('10.10.6.7(1414)')
    DEFINE CHANNEL(TO.NEWYORK) +
           CHLTYPE(CLUSSDR) TRPTYPE(TCP) +
           CLUSTER(INVENTORY) +
           CONNAME('10.9.20.5(1414)')
  2. 设置 NEWYORK 服务器。
    打开命令提示符并输入以下命令:
    runmqsc
    ALTER QMGR REPOS(INVENTORY)
    DEFINE QLOCAL(MQIPT.LOCAL.QUEUE) +
           CLUSTER(INVENTORY)
    DEFINE CHANNEL(TO.NEWYORK) +
           CHLTYPE(CLUSRCVR) TRPTYPE(TCP) +
           CLUSTER(INVENTORY) +
           CONNAME('10.9.20.5(1414)')
    DEFINE CHANNEL(TO.LONDON) +
           CHLTYPE(CLUSSDR) TRPTYPE(TCP) +
           CLUSTER(INVENTORY) +
           CONNAME('10.10.6.7(1414)')
  3. 设置 MQIPT 1。
    编辑 mqipt.conf 并添加以下路由定义:
    [route]
    Name=LONDON to NEWYORK
    ListenerPort=1415
    Destination=10.9.20.5
    DestinationPort=1414
    SocksServer=true
    
    [route]
    Name=MQIPT1 to LONDON
    ListenerPort=1414
    Destination=10.7.20.2
    DestinationPort=1414
  4. 启动 MQIPT 1。
    打开命令提示符并输入以下命令:
    C:\mqipt\bin\mqipt C:\mqiptHome -n ipt1
    其中 C:\mqiptHome 指示 MQIPT 配置文件 mqipt.conf的位置, ipt1 是要提供给 MQIPT实例的名称。
    以下消息指示 MQIPT 已成功启动:
    5724-H72 (C) Copyright IBM Corp. 2000, 2026. All Rights Reserved
    MQCPI001 IBM MQ Internet Pass-Thru V9.4.0.0 starting
    MQCPI004 Reading configuration information from mqipt.conf
    MQCPI152 MQIPT name is ipt1
    MQCPI021 Password checking has been enabled on the command port
    MQCPI011 The path C:\mqiptHome\logs will be used to store the log files
    MQCPI006 Route 1415 has started and will forward messages to :
    MQCPI034 ....10.9.20.5(1414)
    MQCPI035 ....using MQ protocol
    MQCPI052 ....SOCKS server side enabled
    MQCPI078 Route 1415 ready for connection requests
    MQCPI006 Route 1414 has started and will forward messages to :
    MQCPI034 ....10.7.20.2(1414)
    MQCPI035 ....using MQ protocol
    MQCPI078 Route 1414 ready for connection requests
  5. 设置 MQIPT 2。
    编辑 mqipt.conf 并添加以下路由定义:
    [route]
    Name=NEWYORK to LONDON
    ListenerPort=1415
    Destination=10.10.6.7
    DestinationPort=1414
    SocksServer=true
    
    [route]
    Name=MQIPT2 to NEWYORK
    ListenerPort=1414
    Destination=10.9.1.2
    DestinationPort=1414
  6. 启动 MQIPT 2。
    打开命令提示符并输入以下命令:
    C:
    cd \mqipt\bin
    mqipt .. -n ipt2
    其中 .. 指示 MQIPT 配置文件 mqipt.conf位于父目录中, ipt2 是要提供给 MQIPT实例的名称。
    以下消息指示 MQIPT 已成功启动:
    5724-H72 (C) Copyright IBM Corp. 2000, 2026. All Rights Reserved
    MQCPI001 IBM MQ Internet Pass-Thru V9.4.0.0 starting
    MQCPI004 Reading configuration information from mqipt.conf
    MQCPI152 MQIPT name is ipt2
    MQCPI021 Password checking has been enabled on the command port
    MQCPI011 The path C:\mqipt\logs will be used to store the log files
    MQCPI006 Route 1415 has started and will forward messages to :
    MQCPI034 ....10.10.6.7(1414)
    MQCPI035 ....using MQ protocol
    MQCPI052 ....SOCKS server side enabled
    MQCPI078 Route 1415 ready for connection requests
    MQCPI006 Route 1414 has started and will forward messages to :
    MQCPI034 ....10.9.1.2(1414)
    MQCPI035 ....using MQ protocol
    MQCPI078 Route 1414 ready for connection requests
  7. 在伦敦 IBM MQ 客户机 (10.7.20.1) 上的命令提示符处,输入以下命令:
    1. 设置 MQSERVER 环境变量:
      SET MQSERVER=MQIPT.CONN.CHANNEL/tcp/10.7.20.2(1414)
    2. 放置消息:
      amqsputc MQIPT.LOCAL.QUEUE LONDON
      Hello world
      输入消息字符串之后,按 Enter 键两次。
    这会使 LONDON 队列管理器将消息发送到 NEWYORK 队列管理器上的队列中。
  8. 在纽约 IBM MQ 客户机 (10.9.1.3) 上的命令提示符处,输入以下命令:
    1. 设置 MQSERVER 环境变量:
      SET MQSERVER=MQIPT.CONN.CHANNEL/TCP/10.9.1.2(1414)
    2. 获取消息:
      amqsgetc MQIPT.LOCAL.QUEUE NEWYORK
      此时会返回消息“Hello world”。