Procedure

1. Determine which full repository CHICAGO should refer to first

Every queue manager in a cluster must refer to one or other of the full repositories to gather information about the cluster and so build up its own partial repository. It is of no particular significance which repository you choose for any particular queue manager. In this example we choose NEWYORK. Once the new queue manager has joined the cluster it will communicate with both of the repositories.

2. Define the CLUSRCVR channel

Every queue manager in a cluster needs to define a cluster-receiver on which it can receive messages. On CHICAGO define:

DEFINE CHANNEL(TO.CHICAGO) CHLTYPE(CLUSRCVR) TRPTYPE(TCP) CONNAME(CHICAGO.CMSTORE.COM) CLUSTER(INVENTORY) DESCR('Cluster-receiver channel for CHICAGO')

3. Define a CLUSSDR channel on queue manager CHICAGO

Every queue manager in a cluster needs to define one cluster-sender channel on which it can send messages to its first full repository. In this case we have chosen NEWYORK, so CHICAGO needs the following definition:

DEFINE CHANNEL(TO.NEWYORK) CHLTYPE(CLUSSDR) TRPTYPE(TCP) CONNAME(NEWYORK.CHSTORE.COM) CLUSTER(INVENTORY) DESCR('Cluster-sender channel from CHICAGO to repository at NEWYORK')



4. Alter the existing cluster queue INVENTQ

The INVENTQ which is already hosted by the NEWYORK queue manager is the main instance of the queue.

ALTER QLOCAL(INVENTQ) CLWLPRTY(2)

5. Review the inventory application for message affinities

Before proceeding, ensure that the inventory application does not have any dependencies on the sequence of processing of messages. See Reviewing applications for message affinities for more information.

6. Install the inventory application on the system in CHICAGO

See the WebSphere MQ Application Programming Guide for information about how to do this.

7. Define the backup cluster queue INVENTQ

The INVENTQ which is already hosted by the NEWYORK queue manager, is also to be hosted as a backup by CHICAGO. Define it on the CHICAGO queue manager as follows:

DEFINE QLOCAL(INVENTQ) CLUSTER(INVENTORY) CLWLPRTY(1)

Now that you have completed all the definitions, if you have not already done so, you should start the channel initiator on WebSphere MQ for z/OS and, on all platforms, start a listener program on queue manager CHICAGO. The listener program listens for incoming network requests and starts the cluster-receiver channel when it is needed. See "Establishing communication in a cluster" for more information.

The cluster set up by this task looks like this:

Figure 27. The INVENTORY cluster, with four queue managers
The diagram shows the INVENTORY cluster, with NEW YORK, LONDON, CHICAGO and PARIS connected inside the cluster. NEWYORK and LONDON are hosting the inventory application and CHICAGO and NEWYORK are hosting the INVENTQ.

The INVENTQ and the inventory application are now hosted on two queue managers in the cluster. This provides a backup and a main queue. Messages put to INVENTQ are routed to NEWYORK unless it is unavailable when they are sent instead to CHICAGO.