This demo considers creating a cluster environment with four queue managers in which two of them act as full repositories (QM_FR1,QM_FR2) and other two act as partial repositories (QM_PR1,QM_PR2). The full repositories will communicate with each other and the partial repositories will communicate with any of the full repositories using the defined cluster sender receiver channels.
- Create a queue manger QM_FR1, listener, full repository by using the following commands
- CRTMQM QM_FR1<--to create a queue manager
- STRMQM QM_FR1<--to start a queue manage
- RUNMQSC QM_FR1<-- to perform some administrative tasks
- ALTER QMGR REPOS('CLUSTER1')<--To create a cluster and make the queue manager as full repositories
- DEFINE LISTENER(L1) TRPTYPE(TCP) CONTROL(QMGR) PORT(1450)<--to create a listener in the QM_FR1
- START LISTENER(L1)<-- to start listener
- Create a queue manger QM_FR2, listener,cluster sender and cluster receiver channels and make them as full repository by using the following commands
- CRTMQM QM_FR2<--to create a queue manager
- STRMQM QM_FR2<--to start a queue manager
- RUNMQSC QM_FR2<-- to perform some administrative tasks
- ALTER QMGR REPOS('CLUSTER1')<--To create a cluster and make the queue manager as full repositories
- DEFINE LISTENER(L2) TRPTYPE(TCP) CONTROL(QMGR) PORT(1451)<--to create a listener in the QM_FR1
- START LISTENER(L2)<-- to start listener
- Define the cluster receiver channels for the queue managers QM_FR1 and QM_FR2
- DEFINE CHANNEL(TO.QM_FR1) CHLTYPE(CLUSRCVR) CONNAME('LOCALHOST(1450)') CLUSTER('CLUSTER1')<-----to create the cluster receiver channel in QM_FR1
- DEFINE CHANNEL(TO.QM_FR2) CHLTYPE(CLUSSDR) CONNAME('LOCALHOST(1451)') CLUSTER('CLUSTER1')<------to create the cluster sender channel in QM_FR1
- Define the cluster sender channel on the queue managers. The channel name must match that of the cluster sender channel on the full repository
- DEFINE CHANNEL(TO.QM_FR2) CHLTYPE(CLUSRCVR) CONNAME('LOCALHOST(1451)') CLUSTER('CLUSTER1')<----to create the cluster receiver channel in QM_FR2
- DEFINE CHANNEL(TO.QM_FR1) CHLTYPE(CLUSSDR) CONNAME('LOCALHOST(1450)') CLUSTER('CLUSTER1')<------to create the cluster sender channel in QM_FR2
- Create the queue manager QM_PR1, listener and make it as a partial repository by creating cluster sender and cluster receiver channels to full repository
- CRTMQM QM_PR1<------to create the queue manager
- RUNMQSC QM_PR1<-- to perform some administrative tasks
- DEFINE LISTENER(PRL1) TRPTYPE(TCP) CONTROL(QMGR) PORT(1452)<----to create the listener
- START LISTENER(PRL1)<------to start the listener
- DEFINE CHANNEL(TO.QM_PR1) CHLTYPE(CLUSRCVR) CONNAME('LOCALHOST(1452)') CLUSTER('CLUSTER1')<-------to create the cluster receiver channel in QM_PR1(partial repository)
- DEFINE CHANNEL(TO.QM_FR1) CHLTYPE(CLUSSDR) CONNAME('LOCALHOST(1450)') CLUSTER('CLUSTER1')<-------to create the cluster sender channel in QM_PR1(partial repository)
- Create the queue manager QM_PR2, listener and make it as a partial repository by creating cluster sender and cluster receiver channels to full repository
- CRTMQM QM_PR2<------to create the queue manager
- RUNMQSC QM_PR2<-- to perform some administrative tasks
- DEFINE LISTENER(PRL2) TRPTYPE(TCP) CONTROL(QMGR) PORT(1453)<----to create the listener
- START LISTENER(PRL2)<------to start the listener
- DEFINE CHANNEL(TO.QM_PR2) CHLTYPE(CLUSRCVR) CONNAME('LOCALHOST(1453)') CLUSTER('CLUSTER1')<-------to create the cluster receiver channel in QM_PR2(partial repository)
- DEFINE CHANNEL(TO.QM_FR2) CHLTYPE(CLUSSDR) CONNAME('LOCALHOST(1451)') CLUSTER('CLUSTER1')<-------to create the cluster sender channel in QM_PR1(partial repository)
- Create clustered queue in the QM_PR1 which is made available to other queue managers in the cluster
- RUNMQSC QM_PR1 <--to perform some administrative tasks
- DEFINE QLOCAL(CQ1) CLUSTER('CLUSTER1')
- Put a test message into the cluster queue CQ1 from other queue manager QM_FR1 using the command "AMQSPUT" as
- AMQSPUT CQ1 QM_FR1