Setting up a cluster on TCP/IP using multiple transmission queues per queue manager
This is one of three topics describing different configurations for a simple cluster.
Before you begin
For an overview of the cluster that is being created, see Setting up a new cluster.
About this task
Procedure
-
Decide on the organization of the cluster and its name.
You decided to link the two queue managers,
LONDON
andNEWYORK
, into a cluster. A cluster with only two queue managers offers only marginal benefit over a network that is to use distributed queuing. It is a good way to start and it provides scope for future expansion. When you open new branches of your store, you are able to add the new queue managers to the cluster easily. Adding new queue managers does not disrupt the existing network; see Adding a queue manager to a cluster.For the time being, the only application you are running is the inventory application. The cluster name is
INVENTORY
. -
Decide which queue managers are to hold full repositories.
In any cluster you must nominate at least one queue manager, or preferably two, to hold full repositories. In this example, there are only two queue managers,
LONDON
andNEWYORK
, both of which hold full repositories.- You can perform the remaining steps in any order.
- As you proceed through the steps, warning messages might be written to the queue manager log.
The messages are a result of missing definitions that you have yet to
add.
Examples of the responses to the commands are shown in a box like this after each step in this task. These examples show the responses returned by IBM MQ for AIX. The responses vary on other platforms.
- Before proceeding with these steps, make sure that the queue managers are started.
-
Alter the queue manager definitions to add repository definitions.
On each queue manager that is to hold a full repository, alter the local queue manager definition, using the
ALTER QMGR
command and specifying theREPOS
attribute:ALTER QMGR REPOS(INVENTORY)
For example, if you enter:1 : ALTER QMGR REPOS(INVENTORY) AMQ8005: IBM MQ queue manager changed.
runmqsc LONDON
ALTER QMGR REPOS(INVENTORY)
LONDON
is changed to a full repository. -
Alter the queue manager definitions to create separate cluster transmission queues for each destination.
ALTER QMGR DEFCLXQ(CHANNEL)
On each queue manager that you add to the cluster decide whether to use separate transmission queues or not. See the topics, Adding a queue manager to a cluster and Adding a queue manager to a cluster: separate transmission queues.
-
Define the listeners.
Define a listener that accepts network requests from other queue managers for every queue manager in the cluster. On the
LONDON
queue managers, issue the following command:
The CONTROL attribute ensures that the listener starts and stops when the queue manager does.DEFINE LISTENER(LONDON_LS) TRPTYPE(TCP) CONTROL(QMGR)
The listener is not started when it is defined, so it must be manually started the first time with the following MQSC command:
Issue similar commands for all the other queue managers in the cluster, changing the listener name for each one.START LISTENER(LONDON_LS)
There are several ways to define these listeners, as shown in Listeners.
-
Define the CLUSRCVR channel for the
LONDON
queue manager.On every queue manager in a cluster, you define a cluster-receiver channel on which the queue manager can receive messages. See Cluster-receiver channel: CLUSRCVR . The CLUSRCVR channel defines the connection name of the queue manager. The connection name is stored in the repositories, where other queue managers can refer to it. The CLUSTER keyword shows the availability of the queue manager to receive messages from other queue managers in the cluster.
In this example the channel name is
INVENTORY.LONDON
, and the connection name(CONNAME)
is the network address of the machine the queue manager resides on, which isLONDON.CHSTORE.COM
. The network address can be entered as an alphanumeric DNS host name, or an IP address in either in IPv4 dotted decimal form. For example,192.0.2.0
, or IPv6 hexadecimal form; for example2001:DB8:0204:acff:fe97:2c34:fde0:3485
. The port number is not specified, so the default port (1414) is used.DEFINE CHANNEL(INVENTORY.LONDON) CHLTYPE(CLUSRCVR) TRPTYPE(TCP) CONNAME(LONDON.CHSTORE.COM) CLUSTER(INVENTORY) DESCR('TCP Cluster-receiver channel for queue manager LONDON')
1 : DEFINE CHANNEL(INVENTORY.LONDON) CHLTYPE(CLUSRCVR) TRPTYPE(TCP) CONNAME(LONDON.CHSTORE.COM) CLUSTER(INVENTORY) DESCR('TCP Cluster-receiver channel for queue manager LONDON') AMQ8014: WebSphere MQ channel created. 07/09/98 12:56:35 No repositories for cluster 'INVENTORY'
-
Define the CLUSRCVR channel for the
NEWYORK
queue manager.If the channel listener is using the default port, typically 1414, and the cluster does not include a queue manager on z/OS®, you can omit the CONNAMEDEFINE CHANNEL(INVENTORY.NEWYORK) CHLTYPE(CLUSRCVR) TRPTYPE(TCP) CLUSTER(INVENTORY) DESCR('TCP Cluster-receiver channel for queue manager NEWYORK')
-
Define the CLUSSDR channel on the
LONDON
queue manager.You manually define a CLUSSDR channel from every full repository queue manager to every other full repository queue manager in the cluster. See Cluster-sender channel: CLUSSDR . In this case, there are only two queue managers, both of which hold full repositories. They each need a manually-defined CLUSSDR channel that points to the CLUSRCVR channel defined at the other queue manager. The channel names given on the CLUSSDR definitions must match the channel names on the corresponding CLUSRCVR definitions. When a queue manager has definitions for both a cluster-receiver channel and a cluster-sender channel in the same cluster, the cluster-sender channel is started.
DEFINE CHANNEL(INVENTORY.NEWYORK) CHLTYPE(CLUSSDR) TRPTYPE(TCP) CONNAME(NEWYORK.CHSTORE.COM) CLUSTER(INVENTORY) DESCR('TCP Cluster-sender channel from LONDON to repository at NEWYORK')
1 : DEFINE CHANNEL(INVENTORY.NEWYORK) CHLTYPE(CLUSSDR) TRPTYPE(TCP) CONNAME(NEWYORK.CHSTORE.COM) CLUSTER(INVENTORY) DESCR('TCP Cluster-sender channel from LONDON to repository at NEWYORK') AMQ8014: WebSphere MQ channel created. 07/09/98 13:00:18 Channel program started.
-
Define the CLUSSDR channel on the
NEWYORK
queue manager.DEFINE CHANNEL(INVENTORY.LONDON) CHLTYPE(CLUSSDR) TRPTYPE(TCP) CONNAME(LONDON.CHSTORE.COM) CLUSTER(INVENTORY) DESCR('TCP Cluster-sender channel from NEWYORK to repository at LONDON')
-
Define the cluster queue
INVENTQ
Define theINVENTQ
queue on theNEWYORK
queue manager, specifying the CLUSTER keyword.DEFINE QLOCAL(INVENTQ) CLUSTER(INVENTORY)
1 : DEFINE QLOCAL(INVENTQ) CLUSTER(INVENTORY) AMQ8006: WebSphere MQ queue created.
The CLUSTER keyword causes the queue to be advertised to the cluster. As soon as the queue is defined it becomes available to the other queue managers in the cluster. They can send messages to it without having to make a remote-queue definition for it.
All the definitions are complete. On all platforms, start a listener program on each queue manager. The listener program waits for incoming network requests and starts the cluster-receiver channel when it is needed.