ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » How to set MQSERVER env var for LOCAL machine?

Post new topic  Reply to topic
 How to set MQSERVER env var for LOCAL machine? « View previous topic :: View next topic » 
Author Message
lyntongrice
PostPosted: Sun Oct 02, 2011 3:40 am    Post subject: How to set MQSERVER env var for LOCAL machine? Reply with quote

Acolyte

Joined: 26 Sep 2010
Posts: 70

Hi there,

I am trying to do some MQ client code tests on my local machine. I am running Linux Mint and using Webpshere MQ 7.0.

Basically I cannot get the "amqsputc" to work, I want to test CLIENT functionality, not programs "linked" to use the SERVER libs...

I have a queue manager "QM01", but when I try run the following:

./amqsputc QM01 TEST.QUEUE

I get the dreaded 2058 error MQRC_Q_MGR_NAME_ERROR

I have also tried it the other way around

./amqsputc TEST.QUEUE QM01

But still no luck....

I have see numerous posts on this forum for this but for some reason still cannot get it right....

I ideally I would like to just set the MQSERVER env var, something like:

export MQSERVER=SYSTEM.DEF.SRVCONN/TCP/'127.0.0.1(1414)'

But that does not seem to work either as I get the 2538 MQRC_HOST_NOT_AVAILABLE error then ;-(

I have also tried to rather use

export MQCHLLIB=/var/mqm/qmgrs/QM01/@ipcc

export MQCHLTAB=/var/mqm/qmgrs/QM01/@ipcc/AMQCLCHL.TAB

But no luck.....

Can anyone please advise me how I can test MQ Client code on a machine running MQ Server as well?

Sorry for the stupid question, but this is killing me ...

Thanks for the help

Lynton
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Oct 02, 2011 4:54 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

your export MQCHLTAB is wrong. It should just have the file name in it not the path. Hint: the access path concatenates MQCHLLIB and MQCHLTAB...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
bruce2359
PostPosted: Sun Oct 02, 2011 5:17 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9470
Location: US: west coast, almost. Otherwise, enroute.

Have you created a CCDT? Did you define channels of the CLNTCONN type?

Have you read the WMQ Clients manual? Have you read the doc on how to invoke amqsputc, and how to pass parameters to it?

Open a new shell. Display the environment variables. All three should be null. Set only the MQSERVER= environment variable, then test. If you next want to test the CCDT, you will need to unset the MQSERVER= environment variable.
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
lyntongrice
PostPosted: Sun Oct 02, 2011 7:42 am    Post subject: Reply with quote

Acolyte

Joined: 26 Sep 2010
Posts: 70

Hi there,

Thanks for the responses, much appreciated.

And yes, I did not have all 3 env vars set, I would try MQSERVER alone, then the other ones in another shell....

I guess my main issue is I do not know what IP address or "hostname" to put into the MQSERVER string as I am on the local machine. Or even for a client connection definition.....do I put in "localhost(1414"?

I have read through the majority of the IBM doc on "Clients"....the only thing I battle with is how to specify that I am not talking remotely but to my local machine....

I will keep digging, thanks again

Lynton
Back to top
View user's profile Send private message
exerk
PostPosted: Sun Oct 02, 2011 7:54 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

lyntongrice, I deleted the duplicate post. As regards the MQSERVER variable, I usually use localhost(1414) and it works fine for me.
_________________
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
View user's profile Send private message
Vitor
PostPosted: Sun Oct 02, 2011 9:11 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

lyntongrice wrote:
I guess my main issue is I do not know what IP address or "hostname" to put into the MQSERVER string as I am on the local machine. Or even for a client connection definition.....do I put in "localhost(1414"?


Only if the queue manager is listening on 1414.

Aside from that, "localhost" or '127.0.0.1' will specify "this machine" on most Unix.

lyntongrice wrote:
the only thing I battle with is how to specify that I am not talking remotely but to my local machine....


It's not a battle. A server connection is one using RPC calls to talk to a queue manager (which requires it to be on the same machine). A client connection is one using TCP/IP to talk to the queue manager. The only thing you specify is an IP address; that address can be the address of your machine or one the other side of the world. There's no WMQ configuration setting for "TCP to this machine" or "TCP on a remote machine". Just an IP address, where "localhost" is IP shorthand for "this machine.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
lyntongrice
PostPosted: Sun Oct 02, 2011 9:29 am    Post subject: Reply with quote

Acolyte

Joined: 26 Sep 2010
Posts: 70

Hi there,

I have tried "localhost" and it does not fly ;-( I have check and the queue manager is on 1414....

Could it be that my ETH0 is not right? If I do an

lynton@lynton ~ $ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN qlen 1000
link/ether 00:25:64:5a:3e:f6 brd ff:ff:ff:ff:ff:ff
...
...

I cannot see any INET IP address under ETH0? Also, if I try TELNET to port 1414 I get the following:

lynton@lynton ~ $ telnet localhost 1414
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused
lynton@lynton ~ $


Does that sound right? Forgive me if I am being stupid

Thanks

Lynton
Back to top
View user's profile Send private message
lyntongrice
PostPosted: Sun Oct 02, 2011 10:14 am    Post subject: Reply with quote

Acolyte

Joined: 26 Sep 2010
Posts: 70

Hi all,

It is working now, stupid me.....the listener was not started on 1414....so I ran:

runmqlsr -m QM01 -t tcp -p 1414 &

and set the following ENV VAR only:

export MQSERVER=SYSTEM.DEF.SVRCONN/TCP/'localhost(1414)'

And now the amqsputc works 100%

Thanks again,

Lynton
Back to top
View user's profile Send private message
exerk
PostPosted: Sun Oct 02, 2011 10:41 am    Post subject: Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

lyntongrice wrote:
runmqlsr -m QM01 -t tcp -p 1414 &

Don't do this. You're on a version that supports Listeners as objects, which can be placed under queue manager control - use that facility.
_________________
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
View user's profile Send private message
bruce2359
PostPosted: Sun Oct 02, 2011 12:43 pm    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9470
Location: US: west coast, almost. Otherwise, enroute.

exerk wrote:
lyntongrice wrote:
runmqlsr -m QM01 -t tcp -p 1414 &

Don't do this. You're on a version that supports Listeners as objects, which can be placed under queue manager control - use that facility.

Which means using an mq script command command like:
DEFINE LISTENER(TCP.1414) TRPTYPE(TCP) CONTROL(QMGR) PORT(1414)
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Sun Oct 02, 2011 4:15 pm    Post subject: Reply with quote

Jedi Knight

Joined: 25 Mar 2003
Posts: 2538
Location: Melbourne, Australia

bruce2359 wrote:
exerk wrote:
lyntongrice wrote:
runmqlsr -m QM01 -t tcp -p 1414 &

Don't do this.

Yeah, using this command, the listener will probably end when you log off!

Quote:
Quote:
You're on a version that supports Listeners as objects, which can be placed under queue manager control - use that facility.

Which means using an mq script command command like:
DEFINE LISTENER(TCP.1414) TRPTYPE(TCP) CONTROL(QMGR) PORT(1414)

The first time, don't forget to START LISTENER('TCP.1414')
_________________
Glenn
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » How to set MQSERVER env var for LOCAL machine?
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.