.
.讓我們來練習一下 Queue Manager Clusters
.
=== Exercise 5 : Queue Manager Clusters ===
What we will do :
A. Create Clusters.
B. Define all required WebSphereMQ objects for Queue Manager Clusters.
C. Test and Configure Clusters.
D. Manage workload in Clusters.
======================================================
[QM1]————————————
∣Cluster Transmission Queue∣
∣ [ Cluster-Sender CHANNEL ] →→ [QM3]
∣Local Appication Queues ∣ ↙
∣ ∣ [QM2] ↙
∣Cluster Command Queue ∣ ↙ ↙
∣ [ Cluster-Receiver CHANNEL ] ← [QM4]
∣Cluster Repository Q ∣
—————————————
======================================================
[A. Set up the Cluster connections.]
1. Create a new default Queue Manager QM1 to be used in a Queue Manager Cluster.
# crtmqm -q QM1 (-q : 為 default QM)
# crtmqm QM3
2. Start the Queue Manager :
# strmqm QM1
# strmqm QM3
3. Start the Listener function for your Queue Manager QM1 on port 9051
using the WebSphereMQ Listener.
# runmqlsr -m QM1 -t tcp -p 9051
# runmqlsr -m QM3 -t tcp -p 9053
4. Define the Cluster connection objects required for your Queue Manager.
The Objects needed should include the following :
a. One Local Queue to be used as Dead Letter Queue.
# runmqsc QM1
# runmqsc QM3
: DEF QL(DLQ)
: ALTER QMGR DEADQ(DLQ)
: DIS QMGR DEADQ (驗證Dead Letter Queue)
b. One Cluster Receiver CHANNEL (CLUSRVR) pointing to the owning QM.
(On Every Queue Manager in Cluster)
☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
DEF CHL(TO.CLUS_A9.QM#) CHLTYPE(CLUSRCVR) REPLACE +
TRPTYPE(TCP) CONNAME('Hostname(905#)') +
SHORTRTY(600) SHORTTMR(60) DISCINT(30) CLUSTER(CLUS_A9)
☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
( # = your QM in Cluster , 這邊先在 QM1 設接收端)
DEF CHL(TO.CLUS_A9.QM1) CHLTYPE(CLUSRCVR) REPLACE +
TRPTYPE(TCP) CONNAME('localhost(9051)') +
SHORTRTY(600) SHORTTMR(60) DISCINT(30) CLUSTER(CLUS_A9)
( ps : 其實在這邊一執行, 在MQ Explorer就會出現CLUS_A9)
( # = your QM in Cluster , 另一個在 QM3 設接收端)
DEF CHL(TO.CLUS_A9.QM3) CHLTYPE(CLUSRCVR) REPLACE +
TRPTYPE(TCP) CONNAME('localhost(9053)') +
SHORTRTY(600) SHORTTMR(60) DISCINT(30) CLUSTER(CLUS_A9)
c. One Cluster Sender CHANNEL pointing to a (the other) Repository
Queue Manager in your Cluster.
☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
DEF CHL(TO.CLUS_A9.QM*) CHLTYPE(CLUSSDR) REPLACE +
TRPTYPE(TCP) CONNAME('Hostname(905*)') +
SHORTRTY(600) SHORTTMR(60) DISCINT(30) CLUSTER(CLUS_A9)
☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆☆
( * = Full Repository , 這邊在在 QM3 送出)
DEF CHL(TO.CLUS_A9.QM1) CHLTYPE(CLUSSDR) REPLACE +
TRPTYPE(TCP) CONNAME('localhost(9051)') +
SHORTRTY(600) SHORTTMR(60) DISCINT(30) CLUSTER(CLUS_A9)
( * = Full Repository , 另一個 QM1 送出)
DEF CHL(TO.CLUS_A9.QM3) CHLTYPE(CLUSSDR) REPLACE +
TRPTYPE(TCP) CONNAME('localhost(9053)') +
SHORTRTY(600) SHORTTMR(60) DISCINT(30) CLUSTER(CLUS_A9)
d. If your Queue Manager is to be a Full Repository,
ALTER the Queue Manager to include the Cluster name.
ALTER QMGR REPOS(CLUS_A9) (要加入Cluster的QM則執行)
(ps : 這邊也是,可以Check一下,CLUS_A9完整生出來了... lol )
Verify on QM1 => DIS CLUSQMGR(*)
Verify on QM1 => DIS CHSTATUS(*)
Verify on QM1 => PING CHL(TO.CLUS_A9.QM3)
Verify on QM3 => PING CHL(TO.CLUS_A9.QM1)
( 成功的話, => AMQ8020: 連通測試 WebSphere MQ 通道完成。)
( 失敗的話, => AMQ9547: 遠端通道的類型不適合所要求的動作。 )
AMQ9547 : Type of remote channel not suitable for action
Cause :
Its is not possible to start a Cluster Receiver CHANNEL that uses the group Listener port.
Solution :
Start a non-shared Listener (INDISP(QMGR)) and ALTER the Cluster Receiver CHANNEL to
use its port number rather than the group Listener port.
5. Wait until all CHANNELs timed out upon the DISCINT value.
6. What is the CURDEPTH on the SYSTEM.CLUSTER.REPOSITORY.QUEUE ?
DIS Q(SYSTEM.CLUSTER.REPOSITORY.QUEUE) CURDEPTH
[B. Set up the Cluster application objects.]
7. Define the Cluster application objects required on your Queue Manager.
Define all Queues with DEFPSIST(YES) and for all Cluster Queue DEFBIND(OPEN).
a. Two or more Local Cluster Queue QL.C#
(exist in more then one Queue Manager = multi instance Q)
(On QM1 or QM3, 我們先在 QM1 上 DEF 測試一下)
DEF QL(QL.C1) REPLACE DEFPSIST(YES) DEFBIND(OPEN) CLUSTER(CLUS_A9)
8. Wait until all CHANNELs timed out unpon the DISCINT value.
9. What is now the CURDEPTH on the SYSTEM.CLUSTER.REPOSITORY.QUEUE ?
DIS Q(SYSTEM.CLUSTER.REPOSITORY.QUEUE) CURDEPTH
[C. Test Clustering.]
10. Prepare a text file with 9 messages.
Each message should contain a sequence number.
Use this text file in the following steps with amqsput via standard input.
Example :
0001 MSG msg text1............
0002 MSG msg text22...........
0003 MSG msg text333..........
0004 MSG msg text4............
0005 MSG msg text55...........
0006 MSG msg text666..........
0007 MSG msg text7............
0008 MSG msg text88...........
0009 MSG msg text999..........
11. From the non-repository Queue Manager, run amqsput to put messages to the
Cluster Queue that is not defined on that Queue Manager.
Check which Queue and Queue Manager the messages arrive on.
a. QL.C# (Cluster Queue)
# amqsput QL.C1 QM3
- All messages are put again on one instance of Queue.
- CHANNEL activity to full repository and to QM where messages are put.
12. Set DEFBIND(NOTFIXED) for all Cluster Queues on all Queue Managers in your Cluster.
Is there any CHANNEL activity in the whole Cluster ?
- ALTER QL(QL.C1) DEFBIND(NOTFIXED)
or - DEF QL(QL.C1) REPLACE DEFPSIST(YES) DEFBIND(NOTFIXED) CLUSTER(CLUS_A9)
- Yes, because the change of the DEFBIND attribute has to be communicated.
13. On which instances of the destination Queue do the messages arrive ?
Is there any CHANNEL activity ?
- The messages are now distributed between all instances of the Queue QL.C# (Round Robin)
- Because of remote operations we have CHANNEL activity.
14. Stop one of the Remote Cluster Queue Managers.
15. Again put 9 messages to the Cluster Queue that is not Local on your Queue Manager.
- the messages are now put to the remaining instances of the Queue QL.C#
16. Restart the previously stopped Cluster Queue Manager.
17. Disable puts on all Queue instances of QL.C# in your Cluster.
18. Again put 9 messages to QL.C#
19. Explain the error indication you get :
- Reason Code 2268 is returned to the putting application.
The status PUT(DISABLED) is also know on the Local Queue Manager even all
instances are located on Remote QMGR in the Cluster.
- The Cluster Queue entry in the Local Queue Manager is holding this information.
- DIS Q(QL.C*) CLUSINFO ALL
※ Full Repository : is a Queue Manager that hosts a complete set of information about every Queue Manager in the cluster.
※ Partial Repositories : are other Queue Managers in the cluster [that] inquire about the information in the full repositories and build up their own subsets of this information.
※ If MQ Cluster configured with only one Full Repository, it has a single point of failure. The Cluster won't function if that Full Repository goes down. Otherwise, by using multiple Full Repositories, if one Full Repository goes down, the other Full Repositories will take over to manage the Cluster.
※ Each Queue Manager should have at least one Cluster-Sender CHANNEL (CLUSSDR) and one Cluster-Receiver CHANNEL (CLUSRCVR), regardless if the Queue Manager is a full or a partial repository. The only exception to this is for MQ Clusters with only one full repository. This full repository should only have a Cluster-Receiver CHANNEL (CLUSRCVR).
※ A Full Repository pushes its information via a Cluster-Sender CHANNEL (CLUSSDR) to another full repository's Cluster-Receiver CHANNEL (CLUSRCVR). These two CHANNELs should have the same name.
=== Set MQ Cluster Using IBM WebSphereMQ Explorer ===
(E1) Queue Manager Clusters :
http://publibfp.boulder.ibm.com/epubs/pdf/csqzah07.pdf
(E2) Configuring WebSphereMQ Cluster :
沒有留言:
張貼留言