Author |
Message
|
melissa |
Posted: Tue Jun 06, 2006 6:47 am Post subject: How to create a cluster queue |
|
|
Novice
Joined: 06 Jun 2006 Posts: 19
|
Hello,
I have done a cluster queue manager with 2 queue managers and it is good, i manage to send message one to other queue manager. Now, I want to create a cluster queue sp to define the same cluster queue in the 2 queues manager but i don't manage. I have read the cluster IBM manual but I don't success. Someone know how to do? Please help me i have no many time to do it.
And i don't manage to use MQ call, how doing MQOPEN abd MQOPEN?
Mélissa |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 06, 2006 6:51 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Bonjour,
Interestingly it seems I actually understood most of your French post correctly; though I'm not going to let that go to my head!
When you try and declare the cluster queue in the 2 queue managers what goes wrong? What is the error that you get?
And some more detail on your problem with MQOPEN please. What are you trying to achieve? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Anirud |
Posted: Tue Jun 06, 2006 4:10 pm Post subject: Re: How to create a cluster queue |
|
|
 Master
Joined: 12 Feb 2004 Posts: 285 Location: Vermont
|
melissa wrote: |
Hello,
I have done a cluster queue manager with 2 queue managers and it is good, i manage to send message one to other queue manager. Now, I want to create a cluster queue sp to define the same cluster queue in the 2 queues manager but i don't manage. I have read the cluster IBM manual but I don't success. Someone know how to do? Please help me i have no many time to do it.
And i don't manage to use MQ call, how doing MQOPEN abd MQOPEN?
Mélissa |
Are you trying to findout if we can create a cluster queue with the same name on 2 queue managers?
Yes, that can be done. Check workload balancing in the Queue Manager Clusters Manual. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jun 06, 2006 4:51 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The only difference between a queue that is in the cluster and queue that is not in the cluster is the "cluster" attribute of the queue.
So use mqsc on each queue manager in the cluster as such
Code: |
def qlocal(MY.QUEUE.NAME) cluster(MY.CLUSTER.NAME) |
Then you will see in MQ Explorer that there are 3 queues with the name "MY.QUEUE.NAME" on each queue manager - one QLOCAL, and two QCLUSTERS (one for each, including the qlocal).
When doing the MQOPEN, you just issue the MQOPEN using the name "MY.QUEUE.NAME" or whatever it is called.
If you wish to make sure that all the messages you send go to ONE queue in the cluster, then use the MQOO_BIND_ON_OPEN.
If you wish to make sure that all the messages you send go to SEVERAL queues in the cluster, then use the MQOO_BIND_NOT_FIXED. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
melissa |
Posted: Wed Jun 07, 2006 12:38 am Post subject: |
|
|
Novice
Joined: 06 Jun 2006 Posts: 19
|
I have define my cluster in that way:
*********
* SERV1 *
*********
ALTER QMGR REPOS(CLUSTER)
DEFINE CHANNEL(TO.SERV1) CHLTYPE(CLUSRCVR) TRPTYPE(TCP) CONNAME('serv1(1499)') CLUSTER(CLUSTER) DESCR('Cluster-receiver channel pour SERV1) REPLACE
DEFINE CHANNEL(TO.SERV2) CHLTYPE(CLUSSDR) TRPTYPE(TCP) CONNAME('serv2(1499)') CLUSTER(CLUSTER) DESCR('CLUSSDR channel de SERV1 vers le referentiel de SERV2') REPLACE
DEFINE QLOCAL(CLUSTQUEUE) CLUSTER(CLUSTER)
**********
* SERV2 *
**********
ALTER QMGR REPOS(CLUSTER)
DEFINE CHANNEL(TO.SERV2) CHLTYPE(CLUSRCVR) TRPTYPE(TCP) CONNAME('serv2(1499)') CLUSTER(CLUSTER) DESCR('Cluster-receiver channel pour SERV2') REPLACE
DEFINE CHANNEL(TO.SERV1) CHLTYPE(CLUSSDR) TRPTYPE(TCP) CONNAME('serv1(1499)') CLUSTER(CLUSTER) DESCR('CLUSSDR channel de SERV2 vers le referentiel de SERV1') REPLACE
=> it's my queue manager cluster and tests success:
**********
* SERV2 *
**********
# amqsput CLUSTQUEUE SERV2.B1
Sample AMQSPUT0 start
target queue is CLUSTQUEUE
hello
ca va
Sample AMQSPUT0 end
*********
* SERV1 *
*********
# amqsget CLUSTQUEUE SERV1.B1
Sample AMQSGET0 start
message <hello>
message <ca va>
no more messages
Sample AMQSGET0 end
=> SERV1.B1 is the QMGR of SERV1 and SERV2.B1 is the QMGR of SERV2.
And to create a queue cluster, i have add the following lines (i have find them on the ibm manual of cluster):
**********
* SERV2 *
**********
define queue (CLUSTQUEUE) cluster (CLUSTER)
ALTER QMGR CLWLDATA(TO.PAXOS) CLWLEXIT(/opt/mqm/samp/amqswlm0.c)
Is it good?
And i have done the following tests:
*********
* SERV2 *
*********
export MQSERVER='SYSTEM.DEF.SVRCONN/TCP/serv1(1499)'
(dans opt/mqm/samp/bin)
amqsput CLUSTQUEUE SERV1.B1
Sample AMQSPUT0 start
target queue is CLUSTQUEUE
test1
test2
test3
Sample AMQSPUT0 end
export MQSERVER='SYSTEM.DEF.SVRCONN/TCP/serv2(1499)'
amqsget CLUSTQUEUE SERV2.B1
Sample AMQSGET0 start
message <hey>
message <ho>
message <hihi>
no more messages
Sample AMQSGET0 end
=> messages are different so it doesn't operate
You know how to do and how to create queue cluster???
And for the MQ CALL, on which directory MQ CALL must be launch??
Help me please.
Mélissa |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 07, 2006 1:03 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
You don't say what version of MQ you're using, but below V6 (and on V6 by default I believe) if there is a version of a cluster queue local to the putting application the message will go there. Hence if the amqsput runs on SERV1 it will put to SERV1.CLUSTQUEUE, on SERV2 it will go onto SERV2.CLUSTQUREUE and before you defined SERV2.CLUSTQUEUE all the messages went to SERV1.CLUSTQUEUE as the only instance.
This is working as IBM intended.
There are a number of ways round this. For instance, a common solution is to define a gateway queue manager (SERV3?) which does not have CLUSTQUEUE on it and put from there. The messages will then go to SERV1 & SERV2 alternately or as definied in the workload exit (amqswlm).
(Note: you don't have to include the sample if you're using the IBM supplied method. IMHO best not to).
If you're using v6 there are a number of new parameters you can use to influence the destination of the messages - look up CLWLPRTY, CLWLRANK, CLWLUSEQ & CLWLWGHT.
Have fun  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
melissa |
Posted: Wed Jun 07, 2006 1:14 am Post subject: |
|
|
Novice
Joined: 06 Jun 2006 Posts: 19
|
I'm using MQseries version 5.1. If I define a new QMGR, i have to create a cluster queue instance on it....it's my intention to create a queue cluster so each queue manager will contain an instance of my queue. You know how to do this?? How using MQ CALL, can you give me an example with all the steps i must follow and by specify on which directory you launch your commands please. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 07, 2006 1:26 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Firstly, version 5.1 is very, very old. Old to a level where I think cluster support was a very iffy support pack. Consider upgrading. Very seriously consider upgrading.
Secondly, there's nothing stopping you creating a cluster queue instance on each new queue manager, just like there's nothing stopping you not creating a cluster queue instance on each new queue manager. It's a design decsion and it's your decision. All I'm saying is that if you do that, messages will flow to the local queue when you put them. That didn't seem to be what you were trying to do but I could have been wrong.
If as you say you intend to create a cluster where each clustered queue manager contains an instance of the queue then just repeat the steps you've followed. Note that not all the queue managers (as indicated in the manual) need to be repositories.
I don't understand what you mean by MQ CALL - where have you seen this. The commands can be launched from any directory in which runmqsc can be run. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
melissa |
Posted: Wed Jun 07, 2006 1:33 am Post subject: |
|
|
Novice
Joined: 06 Jun 2006 Posts: 19
|
Actuelly, I can't upgrade because I'm not allow to do it. What can I do not to use the local version of mu queue. MQ CALL are MQOPEn, MQPUT....I have no many time to create my cluster queue so help me please...
Mélissa |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 07, 2006 1:50 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
You have people who are forcing you to use clustering on 5.1? That has to be against some kind of EU directive, if not the human rights legislation!
On that version of the software if there is a local version of the cluster queue the application will use it. Perhaps you could override this by writing your own version of workload exit, but that would be contact admin in so many ways I shudder to think of them and I'm not convinced it would work anyway. I think your best bet would be to use standard point to point rather than try to bend the cluster into a spiral trying to meet your needs.
Well actually I think you best bet would be upgrading, but you've discounted that!
You access the MQI calls (MQOPEN et al) by linking your program with the correct MQ libraries for your language & platform. The directories they're stored in and link instructions are laid out in the Application Programming Guide & Application Programming Reference. Once linked they can be used fom anywhere subject to path restrictions on your machine. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
melissa |
Posted: Wed Jun 07, 2006 1:53 am Post subject: |
|
|
Novice
Joined: 06 Jun 2006 Posts: 19
|
Can you give me an example to do an MQOPEN call please ?
You think I can't create cluster queue with MQSeries V5.1? |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 07, 2006 2:00 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
No, I think you can because apparently you have therefore you can. What you can't do in that ancient version is redirect a message to a non-local version of a cluster queue where a local one exists. The ability to do that was one of the key new features of v6. If you insist on trying it your only option is to try and sort it out in the workload exit, and the programming effect and resulting problems of doing that would be an order of magnitude greater than doing it with the application & point-to-point. Especially on a version that old for which support will be very thin on the ground.
Or create a gateway queue manager as I suggested a few posts up!
Examples of the MQOPEN and all the other can be found in the samples directory on your installation. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
melissa |
Posted: Wed Jun 07, 2006 2:08 am Post subject: |
|
|
Novice
Joined: 06 Jun 2006 Posts: 19
|
what are the comands to link the library please? |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 07, 2006 2:12 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
They're the ones in the Application Programming Guide, in the section that relates to your platform and language (neither of which you've mentioned at this point).
Also, are you absolutely certain you're using 5.1? You are honestly on a site that think's that's a good thing to be using?  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
melissa |
Posted: Wed Jun 07, 2006 2:19 am Post subject: |
|
|
Novice
Joined: 06 Jun 2006 Posts: 19
|
I work on an AIX and SUN's hosts, the language is C...I have already read the Application Programming guide but I don't manage to launch an MQOPEN call.... |
|
Back to top |
|
 |
|