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 » IBM MQ File Transfer Edition » Run agents like a MQ service!!!!

Post new topic  Reply to topic
 Run agents like a MQ service!!!! « View previous topic :: View next topic » 
Author Message
JonathanR
PostPosted: Wed Jun 03, 2009 3:03 am    Post subject: Run agents like a MQ service!!!! Reply with quote

Newbie

Joined: 03 Jun 2009
Posts: 1

Hello,

I'm trying to configure the agents as MQ services. It works properly when I run MQ, the agents start with the MUSR_MQADMIN but when I stop MQ, the agents don´t stop.

I can see this in the agent log : BFGAG0048W: A client transport mode connection cannot be established to queue manager 'QM2' on host 'localhost', port '1415' and using channel 'SYSTEM.DEF.SVRCONN'. The reason code is 2059. The agent will retry the operation every 30 seconds

So what I can do to stop the agent automatically like a service?

Can I start MQ with another different user?


Thank you very much
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jun 03, 2009 3:25 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You can start MQ as a different user, if you really felt like it, but that wouldn't remotely solve your 2059 problem, which is entirely an issue with the agent configuration.

Your 2059 problem is also likely keeping the agents from stopping because they've never really started in the first place.
Back to top
View user's profile Send private message
PeteVerdon
PostPosted: Thu Jun 04, 2009 2:32 am    Post subject: Reply with quote

Apprentice

Joined: 11 Feb 2009
Posts: 33
Location: Hursley, UK

I'm not familiar with MQ Services, but a glance at the InfoCenter shows that they are stopped by running a command. Presumably you have configured your FTE service to run the fteStopAgent command when the service is stopped.

fteStopAgent works by sending a shutdown message to the agent's command queue. If the agent can't connect to its queue manager to read that queue, it will never get the message and hence never stop.

As the error message shows, your agent is failing to connect to the queue manager (unless there's another message saying that it succeeded after retrying, but you don't mention this). This is the problem you need to fix; you should approach it like any client connection issue as there's nothing special to FTE going on. Obvious things to check include a running listener on port 1415, an available channel called SYSTEM.DEF.SVRCONN, and no firewalls or similar network issues.

Assuming this is an FTE "Server" installation (and if it isn't, it's not permitted to be run on the same machine as its QM ) you might also prefer to use a bindings mode connection instead of involving the network. To do this, remove the agentQMgrHost property in the agent.properties file for the agent.

I hope this helps - let me know how it goes.

Pete
Back to top
View user's profile Send private message
kodiakk
PostPosted: Wed Aug 12, 2009 8:00 am    Post subject: Reply with quote

Acolyte

Joined: 04 Dec 2007
Posts: 58
Location: Jacksonville, Fl.

In reading through this thread, it never really, clearly, states if it's possible to run the Agents as an MQ SERVICE. I'm scouring the REDBOOK that is out, and the MQ FTE Information Center, without much success.
I am looking for a way to run the agents WITHOUT executing them from my personal ID. One of our developers configured the agent to start as a WINDOWS service, but that seems to be only partially successful.

Any help or direction as to how to make these run as an MQ service would be greatly appreciated.

Thanks!
_________________
"Don't take life too seriously... you won't get out of it alive..."
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Aug 12, 2009 9:00 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Create a shell script (or windows batch file) that starts the FTE agents, and one that stops the FTE agents.

Test those extensively until you are sure that they function and log everything you need them to log in cases of failure.

Define an MQ Service that executes those shell scripts in the STARTCMD and STOPCMD fields. Configure the service under QMGR control.

et voila.
Back to top
View user's profile Send private message
kodiakk
PostPosted: Wed Aug 12, 2009 10:40 am    Post subject: Reply with quote

Acolyte

Joined: 04 Dec 2007
Posts: 58
Location: Jacksonville, Fl.

I've had a few batch files defined and running for about two weeks now... 4, actually. Startagent.bat, Stopagent.bat, Pingagent.bat, and listagent.bat.
I'm banging my head against a brick wall trying to get MQ to execute them at the queue manager startup, however.
I copied the files from my desktop to the C:\ directory, just to streamline this process.
So, in the Start Command field, I'm putting in C:\Startagent.bat. No arguments are being supplied, as the .bat file already has them in there.
I restart the queue manager, and see in the error logs that MQ THINKS it started the .bat file, but my pingagent commands never return before timeouts, and when I execute the startagent command manually, it starts...
What am I doing wrong?
_________________
"Don't take life too seriously... you won't get out of it alive..."
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Aug 12, 2009 11:57 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Did you give the MUSR_MQADMIN permissions to execute those batch files, or even access them?

Did you enable proper logging from within those batch files such that you could see if they were getting executed but then throwing errors or not getting executed at all?
Back to top
View user's profile Send private message
kodiakk
PostPosted: Wed Aug 12, 2009 11:59 am    Post subject: Reply with quote

Acolyte

Joined: 04 Dec 2007
Posts: 58
Location: Jacksonville, Fl.

I did give MUSR_MQADMIN full authority on the batch files... they should be able to do anything at all with them.
Unfortunately, I don't know how to enable logging from the batch files...
_________________
"Don't take life too seriously... you won't get out of it alive..."
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Aug 12, 2009 12:07 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

echo Hello World > log.txt
Back to top
View user's profile Send private message
kodiakk
PostPosted: Thu Aug 13, 2009 5:25 am    Post subject: Reply with quote

Acolyte

Joined: 04 Dec 2007
Posts: 58
Location: Jacksonville, Fl.

Here's the service I have defined, which doesn't seem to work. The two .bat files listed here both work from a command line or simply double-clicking on the icon. I've given full authority to the MUSR_MQADMIN id to the directory that these .bat files reside in, as well as the files themselves, and even the C:\IBM\WMQFTE\bin directory. Nothing appears in either of the output files defined below.
Again, any insight would be greatly appreciated!

DEFINE SERVICE ('STARTFTEAGENT') +
* ALTDATE (2009-08-13) +
* ALTTIME (09.11.12) +
DESCR('Service to start MQ FTE agent on qmgr start.') +
STARTCMD('C:\Startagent.bat') +
STARTARG(' ') +
STOPCMD('C:\Stopagent.bat') +
STOPARG(' ') +
STDOUT('C:\startagent.log') +
STDERR('C:\startagenterr.log') +
CONTROL(QMGR) +
SERVTYPE(COMMAND) +
REPLACE
_________________
"Don't take life too seriously... you won't get out of it alive..."
Back to top
View user's profile Send private message
kodiakk
PostPosted: Tue Aug 18, 2009 6:01 am    Post subject: Reply with quote

Acolyte

Joined: 04 Dec 2007
Posts: 58
Location: Jacksonville, Fl.

To all:
Yesterday, I was provided with the following definition to run FTE Agents like a service. It assumes that the FTE installation was done under D:\IBM\WMQFTE, and that your AGENT is named "AGENT1", but those can obviously be changed to suit your personal environment/preferences. It seems to be working very well on my test machine so far.


DEFINE SERVICE('FTE_AGENT1') +
DESCR('Start FTE Agent1') +
SERVTYPE(SERVER) +
CONTROL(STARTONLY) +
STARTCMD('java') +
STARTARG('-cp D:\IBM\WMQFTE\LIB\com.ibm.wmqfte.bootstrap.jar;D:\IBM\WMQFTE\LIB\com.ibm.wmqfte.exitroutines.api.jar -Dcom.ibm.wmqfte.product.root="d:\IBM\WMQFTE" com.ibm.wmqfte.agent.bootstrap.impl.BootstrapMain com.ibm.wmqfte.api.StartAgent -F AGENT1') +
STOPCMD('java') +
STOPARG('-cp D:\IBM\WMQFTE\LIB\com.ibm.wmqfte.bootstrap.jar;D:\IBM\WMQFTE\LIB\com.ibm.wmqfte.exitroutines.api.jar -Dcom.ibm.wmqfte.product.root="d:\IBM\WMQFTE" com.ibm.wmqfte.agent.bootstrap.impl.BootstrapMain com.ibm.wmqfte.api.StopAgent AGENT1') +
REPLACE
_________________
"Don't take life too seriously... you won't get out of it alive..."
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 » IBM MQ File Transfer Edition » Run agents like a MQ service!!!!
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.