Author |
Message
|
girish_tharwani |
Posted: Wed Jun 22, 2011 6:15 am Post subject: One gateway qmgr for two clusters |
|
|
 Voyager
Joined: 01 Aug 2001 Posts: 88 Location: Pune, India
|
I have a gateway qmgr (GTW) which is part of two clusters (say A and B). Cluster A has two more qmgrs A1 and A2. Cluster B also has two more qmgrs B1 and B2. All four qmgrs A1, A2, B1 and B2 have same name local queue (LQ) which are shared in clusters A and B respectively. So there are four instances of LQ visible from GTW.
Another qmgr (X) outside of both these clusters is connected to GTW via a Sender - Receiver pair. I want to use the GTW to route the messages coming from X to LQs which I am able to do using the usual mechanism of qmgr aliasing http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzah.doc/qc10790_.htm
However, with this method messages go to all four instances of LQ. I want to put some sort of mechanism on GTW so that I can control the routing of the messages to either two LQs in cluster A or two LQs in cluster B.
One easy way is to use the slightly different queue names like LQ.A and LQ.B instead of same queue name LQ across the clusters. Another way is to have two GTW qmgrs for two clusters (ie not overlapping the clusters at GTW). But I want to avoid both.
Any ideas about how to achieve this will be really appreciated? |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jun 22, 2011 6:17 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Why, exactly, do you want to avoid both perfectly workable options?
If you answer this question, perhaps OTHER workable options can be provided.
If you don't answer this question, then no other workable options are possible. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jun 22, 2011 10:13 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Have you tried creating the cluster alias AA on A1,A2 and cluster alias BB on B1 and B2 and not create any cluster alias on the gateway? Make sure the cluster alias that you are creating is clustered...
Code: |
def qr(AA) rname('') rqmname('') cluster('AA') defbind(notfixed)
def qr(BB) rname('') rqmname('') cluster('BB') defbind(notfixed) |
Now put to queue with cluster/qmgr alias BB on qmgr X and see how the load is balanced...
Have fun  _________________ MQ & Broker admin
Last edited by fjb_saper on Wed Jun 22, 2011 10:16 am; edited 1 time in total |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jun 22, 2011 10:15 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
fjb_saper wrote: |
Have you tried creating the cluster alias AA on A1,A2 and cluster alias BB on B1 and B2 and not create any cluster alias on the gateway? Make sure the cluster alias that you are creating is clustered...
Code: |
def rq(AA) rname('') rqmname('') cluster('AA') |
Now put to queue with cluster/qmgr alias BB on qmgr X and see how the load is balanced... |
Yes, that is one correct way of doing it, but it's not clear if this is not also
Quote: |
use the slightly different queue names like LQ.A and LQ.B instead of same queue name LQ across the clusters |
which girish_tharwani wishes to avoid. |
|
Back to top |
|
 |
mvic |
Posted: Wed Jun 22, 2011 10:16 am Post subject: Re: One gateway qmgr for two clusters |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
girish_tharwani wrote: |
I want to put some sort of mechanism on GTW so that I can control the routing of the messages to either two LQs in cluster A or two LQs in cluster B. |
I haven't tested this (as far as I can remember) but how about...
Suspend A1,A2 from their cluster, wait till they are getting no more work, then stop the CLUSRCVR channels on A1,A2 (or remove said CLUSRCVRs from their cluster). Result: no messages are sent to A1,A2 after you do this.
For how long would you be thinking of doing this? If using a method like the above, the cluster self-management mechanisms might start to expire things if you leave it in such a state for too long. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jun 22, 2011 10:21 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
It "should" work with the same queue name on all 4 qmgrs.
However it would only distinguish the cluster resolution... and not if the queues participate in both clusters...
The assumption here is that A1, A2, GWY are members of cluster AA and B1, B2, GWY are members of cluster BB.
By the fact that the cluster alias is defined as clustered and only defined on the members that do not share the cluster, it should force the resolution to happen only on the non shared members...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
girish_tharwani |
Posted: Thu Jun 23, 2011 8:17 am Post subject: |
|
|
 Voyager
Joined: 01 Aug 2001 Posts: 88 Location: Pune, India
|
I knew I will be asked why can’t I use multiple GTW or different queue names. I had the explanation ready but I did not include it in my first post because I thought it will make the post very long. So here it goes:
Cluster A and B represent two test environment clusters. We have about half a dozen such clusters (A, B, C, D, E, F) overlapping on GTW. We used GTW to connect to external (3rd party) qmgrs) and if we use 1 GTW per cluster, we will have to poke 6 times as many holes in firewall as we have now.
Our current solution is to have cluster name suffix in queue names (eg LQ.A, LQ.B etc) and a qmgr alias on GTW to route the messages to S.C.T.Q. Problem with this solution is that I have to maintain 6 versions of MQ scripts and apps using these queues have to change their config to change the queue names as they move across the environments. The problem is compounded by the fact that we have 100+ qmgrs per cluster, 10+ queues per qmgr and 100s of connecting apps. So something that can help me to get rid of cluster suffix, that would be great.
fjb_saper, I tried you solution and it works. Having one clustered qmgr alias on each participating qmgrs is definitely better than the problem I described above. Thanks for the idea. |
|
Back to top |
|
 |
exerk |
Posted: Thu Jun 23, 2011 8:33 am Post subject: |
|
|
 Jedi Council
Joined: 02 Nov 2006 Posts: 6339
|
girish_tharwani wrote: |
...Our current solution is to have cluster name suffix in queue names (eg LQ.A, LQ.B etc) and a qmgr alias on GTW to route the messages to S.C.T.Q. Problem with this solution is that I have to maintain 6 versions of MQ scripts and apps using these queues have to change their config to change the queue names as they move across the environments. The problem is compounded by the fact that we have 100+ qmgrs per cluster, 10+ queues per qmgr and 100s of connecting apps. So something that can help me to get rid of cluster suffix, that would be great... |
No they don't if they use a QALIAS with an underlying target queue name that changes as you go through the environments - provided your environments are truly separated of course. _________________ It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys. |
|
Back to top |
|
 |
nandu123 |
Posted: Thu Jun 23, 2011 9:01 am Post subject: |
|
|
 Newbie
Joined: 10 Jan 2011 Posts: 5 Location: NewYork
|
Quote: |
It "should" work with the same queue name on all 4 qmgrs.
However it would only distinguish the cluster resolution... and not if the queues participate in both clusters...
|
Is there a way we can achieve this with creating only one cluster Alias AA, instead of both AA and BB? |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Jun 23, 2011 9:33 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
A single queue manager that is a member of two clusters will know about all shared queues in both clusters.
Cluster name resolution is done entirely on the name of the queue, not on the name of the cluster the queue belongs to or on the name of the queue managers that host the shared queues.
If you want to limit the number of holes you have in the firewall, you should look at MQIPT. You can then configure this (I believe) to accept all of your different incoming MQ connections, route them through a single port to another MQIPT that then routes them to the correct qmgr. At least to the best of my knowledge. |
|
Back to top |
|
 |
girish_tharwani |
Posted: Fri Jun 24, 2011 7:07 am Post subject: |
|
|
 Voyager
Joined: 01 Aug 2001 Posts: 88 Location: Pune, India
|
mqjeff wrote: |
Cluster name resolution is done entirely on the name of the queue, not on the name of the cluster the queue belongs to or on the name of the queue managers that host the shared queues.
|
I tried fjp_saper's solution and it works. Instead of creating a generic qmgr alias on GTW, I created a qmgr aliases AA on A1 and A2 and BB on B1 and B2. I shared AAs in cluster A and BBs in cluster B. Now even if the name of LQ is same on all four qmgrs, the messages are routed to either in cluster A qmgrs or cluster B qmgrs depending on the RQMNAME parameter in remote queue on X.
So the overhead of this solution is that instead of creating one qmgr alias, I need one alias per participating qmgr but the queue names can be same now. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jun 24, 2011 7:43 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
girish_tharwani wrote: |
I need one alias per participating qmgr but the queue names can be same now. |
The names of the QLOCALs can be the same, but the names of the QALIASs can't.
That's what I was trying to understand when I asked if that was "the same as"
Quote: |
use the slightly different queue names like LQ.A and LQ.B instead of same queue name LQ across the clusters |
Because you said you were trying to avoid that.
And the apps sending messages now have to send to AA or BB, instead of sending to LQ.A. |
|
Back to top |
|
 |
girish_tharwani |
Posted: Fri Jun 24, 2011 10:06 pm Post subject: |
|
|
 Voyager
Joined: 01 Aug 2001 Posts: 88 Location: Pune, India
|
Solution 1 (Current Solution)
A1: Define QL(LQ.A) CLUSTER(A)
A2: Define QL(LQ.A) CLUSTER(A)
B1: Define QL(LQ.B) CLUSTER(B)
B2: Define QL(LQ.B) CLUSTER(B)
GTW: Define QR(CLUS.A) RNAME(' ') RQMNAME(' ') XMITQ(' ')
GTW: Define QR(CLUS.B) RNAME(' ') RQMNAME(' ') XMITQ(' ')
X1: Define QR(RQ) RNAME(LQ.A) RQMNAME(CLUS.A) XMITQ(GTW)
X2: Define QR(RQ) RNAME(LQ.B) RQMNAME(CLUS.B) XMITQ(GTW)
Comment: I know that instead of two qmgrs aliases, CLUS.A and CLUS.B, I can have one generic qmgrs alisa eg CLUS on GWT and use that name in RQMNAME param of both RQs, but I use two aliases just becuase it gives a visible hint about which cluster we are targetting from which RQ. Its just cosmetic, it does not play any role in real routing. Routing happens on the basis of actual queue name (ie LQ.A or LQ.B)
Problem: If I rename all LQ.A and LQ.B to LQ only, messags coming from both RQs get distributed on all four copies of LQ
fjp_saper inspired solution
A1: Define QL(LQ) CLUSTER(A)
A1: Define QR(CLUS.A) RNAME(' ') RQMNAME(' ') XMITQ(' ') CLUSTER(A)
A2: Define QL(LQ) CLUSTER(A)
A2: Define QR(CLUS.A) RNAME(' ') RQMNAME(' ') XMITQ(' ') CLUSTER(A)
B1: Define QL(LQ) CLUSTER(B)
B1: Define QR(CLUS.B) RNAME(' ') RQMNAME(' ') XMITQ(' ') CLUSTER(B)
B2: Define QL(LQ) CLUSTER(B)
B2: Define QR(CLUS.B) RNAME(' ') RQMNAME(' ') XMITQ(' ') CLUSTER(B)
GTW: Nothing
X1: Define QR(RQ) RNAME(LQ) RQMNAME(CLUS.A) XMITQ(GTW)
X2: Define QR(RQ) RNAME(LQ) RQMNAME(CLUS.B) XMITQ(GTW)
Now the messages coming from X1 go to LQs on A1 and A1 and messages coming from X2 go to B1 and B2.
At first sight it does look a more cumbersome solution becuase I am creating 4 qmgr aliases instead of two (or one if I chose to use generic qmgr alias CLUS on GTW) but in reality its useful becuase:
a) now the RQMNAME value in RQ defs actually makes real sense and plays a significant role in routing.
b) one alias def (CLUS.A or CLUS.B) on A1, A2, B1 and B2 is effiective for all queues on those qmgrs which as I mentioned earlier are more than 10s per qmgrs
c) an LQ is an LQ now, not LQ.A or LQ.B
d) and most importantly, the cluster boundaries are enforeced effectively. this setup is now able to distinguish an LQ in cluster A from an LQ in cluster B
I am yet to test what happens if I remove LQs from clusters all together and leave only CLUS.A or CLUS.B shared in the clusters. I do not think it will work but I will try it on Monday. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Jun 25, 2011 12:15 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
If you remove the LQ from the cluster you will need to change to cluster alias to target the local qmgr:
Code: |
def QR(cluster.a) rqmname(a1) rname('') xmitq('') cluster(a)
def qr(cluster.a) rqmname(a2) rname('') xmitq('') cluster(a) |
and the cluster repository will complain with good reason that your clustered queue cluster.a has a different definition depending on the qmgr hosting it... unless you want to add another level of indirection (qmgr alias non clustered) to it...
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
girish_tharwani |
Posted: Sat Jun 25, 2011 5:10 am Post subject: |
|
|
 Voyager
Joined: 01 Aug 2001 Posts: 88 Location: Pune, India
|
fjb_saper wrote: |
and the cluster repository will complain with good reason that your clustered queue cluster.a has a different definition depending on the qmgr hosting it... unless you want to add another level of indirection (qmgr alias non clustered) to it...
|
Now that would be stretching it little too far, wouldn’t it
I am happy with the solution with LQs shared in cluster. |
|
Back to top |
|
 |
|