Pages

Thursday, 5 January 2012

Websphere MQ Questions


1.PAth to find the mq logs on HP_UX for specific QUEUE MANAGER

/var/mqm/log/UFISMQ/active

Errors

/var/mqm/errors

2.How to alter LogPrimaryFiles ,LogFilePages and LogPath for already created queuemanager ?


Ans:Using amqhlctl.lfh.If you edit this file we can change the primary logs,secondary logs and log file pages.


Ex: 1.) Create a dummy qmgr with the appropriate log file size, lets call the
qmgr DUMMY.
$ crtmqm -lf 8192 -lp 10 -ls 5 DUMMY NOTE: The crtmqm
with large log files may take a few minutes.

2.) Next, stop the qmgr for which you are reallocating the logs.
$ endmqm -i queue-manager-name

3.) Then change directory ( cd ) to the current qmgr log directory and
delete ( rm ) file amqhlctl.lfh.
$ cd /var/mqm/log/queue-namager-name
$ rm amqhlctl.lfh

4.) Then change directory to the active directory and delete the old
logs.
$ cd active
$ rm *.LOG

5.) Copy ( cp ) from DUMMY qmgr directory the amqhlctl.lfh file and the
newly created logs to the dirctory of the Queue Manager for which
you are reallocating the logs.
$ cd /var/mqm/log/DUMMY
$ cp -pr * /var/mqm/log/Old_QMgr

6.) Update the current qmgr qm.ini Log: stanza with the updated logfile
sizes.

#* *#
#* *#
Log:
LogPrimaryFiles=10
LogSecondaryFiles=5
LogFilePages=8192
LogType=CIRCULAR
LogBufferPages=17
LogPath=/var/mqm/log/QMMQIP01/
LogWriteIntegrity=TripleWrite

7.) Delete the Dummy qmgr and restart the production qmgr.
$ dltmqm DUMMY
$ strmqm queue-manager-name


NOTE: Your better off just backing up the QM definitions with MS03, deleting the QM and recreating it with the correct size logs.

In fact only LogFilePages requires that you recreate the queue manager.

For all other changes the qmgr should be stopped.
Modify the # of primary/secondary logfiles, modify the LogPath and move the files accordingly, do not IIRC need you to recreate the queue manager. Just be sure you have it stopped while you move the logs and change the log stanza. Restart the qmgr and it should now conform to the new rules.

However as previously stated, changing the logfile size, will mandate a delete and recreate of the qmgr.


……………………………………………………………………………………………………………………………………………………………………………………………………………..


·  To stop any listeners associated with the queue managers, using the command:

endmqlsr -m QMgrName


Path for sample MQ programs on HP_UX system

/opt/mqm/samp

Installation:

The WebSphere® MQ product code is installed in /opt/mqm. If you cannot install the product code in the /opt/mqm file system because the file system is too small to contain the product, you can do one of the following:
  1. Create a new file system and mount it as /opt/mqm. If you choose this option, the new file system must be created and mounted before installing the product code.
  2. Create a new directory anywhere on your machine, and create a symbolic link from /opt/mqm to this new directory. For example:
  mkdir /bigdisk/mqm
  ln -s /bigdisk/mqm /opt/mqm
If you choose this option, the new directory must be created, and the link created, before installing the product code.

/var/mqm  –    for Websphere MQ working data.
Path to find the channel and qmstatus.ini and queues present in the dir
/var/mqm/qmgrs/UFISMQ
Creating the user ID and group
Create the required user ID and group ID before you install WebSphere® MQ. Both user ID and group ID must be set to mqm. For stand-alone machines, you can create the new user ID and group IDs locally; for machines administered in a network information services (NIS) domain, an administrator must create the IDs on the NIS master server machine.
It is also suggested that you set the mqm user's home directory to /var/mqm.
You can use the System Administration Manager (SAM) to work with user IDs.
If you want to run administration commands, for example crtmqm (create queue manager) or strmqm (start queue manager), your user ID must be a member of the mqm group.
Users do not need mqm group authority to run applications that use the queue manager; it is needed only for the administration commands.
Note: No symbolic links are required for the 64-bit WebSphere MQ libraries required by WebSphere MQ commands

//There are two configuration files are available in IBM MQ

1.mqs.ini : This file will gives information about all queue manangeers and default queue manager
Path :/var/mqm/mqs.ini
2.qm.ini : this is the configuration file defined for each specific queue manager.This file will creates automatically after queue manager was created.
Path : /var/mqm/qmgrs/QNAME

Queue manager configuration files, qm.ini
A queue manager configuration file, qm.ini, contains information relevant to a specific queue manager. There is one queue manager configuration file for each queue manager. The qm.ini file is automatically created when the queue manager with which it is associated is created.
A qm.ini file is held in the root of the directory tree occupied by the queue manager. For example, the path and the name for a configuration file for a queue manager called QMNAME is:
/var/mqm/qmgrs/QMNAME/qm.ini
The queue manager name can be up to 48 characters in length. However, this does not guarantee that the name is valid or unique. Therefore, a directory name is generated based on the queue manager name. This process is known as name transformation. For a description, see Understanding WebSphere MQ file names.
Figure 1 shows how groups of attributes might be arranged in a queue manager configuration file in WebSphere® MQ for UNIX® systems.
Figure 1. Example queue manager configuration file for WebSphere MQ for UNIX systems
#* Module Name: qm.ini                                             *#
#* Type       : WebSphere MQ queue manager configuration file      *#
#  Function   : Define the configuration of a single queue manager *#
#*                                                                 *#
#*******************************************************************#
#* Notes      :                                                    *#
#* 1) This file defines the configuration of the queue manager     *#
#*                                                                 *#
#*******************************************************************#

ExitPath:
   ExitsDefaultPath=/var/mqm/exits
   ExitsDefaultPath64=/var/mqm/exits64

Service:
   Name=AuthorizationService
   EntryPoints=13

ServiceComponent:
   Service=AuthorizationService
   Name=MQSeries.UNIX.auth.service
   Module=/opt/mqm/bin/amqzfu 1
   ComponentDataSize=0

Log:
   LogPrimaryFiles=3
   LogSecondaryFiles=2
   LogFilePages=1024
   LogType=CIRCULAR
   LogBufferPages=0
   LogPath=/var/mqm/log/saturn!queue!manager/

XAResourceManager:
   Name=DB2 Resource Manager Bank
   SwitchFile=/usr/bin/db2swit
   XAOpenString=MQBankDB
   XACloseString=
   ThreadOfControl=THREAD

Channels: 2
   MaxChannels=20
   MaxActiveChannels=100
   MQIBindType=STANDARD

TCP:
   KeepAlive = Yes

QMErrorLog:
   ErrorLogSize=262144
   ExcludeMessage=7234
   SuppressMessage=9001,9002,9202
   SuppressInterval=30

ApiExitLocal:
   Name=ClientApplicationAPIchecker
   Sequence=3
   Function=EntryPoint
   Module=/usr/Dev/ClientAppChecker
   Data=9.20.176.20
Notes for Figure 1:
  1. /usr/mqm/bin/amqzfu on AIX®
  2. For more information on the Channel stanza, see the WebSphere MQ Intercommunications manual.
fa12510_
…………………………………………………………………………………………………..

MQ Manager Stops Responding To JMS Requests
 Technote (FAQ)

Problem
MQ Manager stops responding to JMS requests.

SystemOut.log:
FreePool E J2CA0046E: Method createManagedConnctionWithMCWrapper caught an exception during creation of the ManagedConnection for resource JMS$cftestcf$JMSManagedConnection@1373738090, throwing ResourceAllocationException. Original exception: javax.resource.spi.ResourceAdapterInternalException: Failed to create session
at com.ibm.ejs.jms.JMSCMUtils.mapToResourceException(JMSCMUtils.java:125)
at com.ibm.ejs.jms.JMSManagedSession.<init>(JMSManagedSession.java:213)
. . .
javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager for 'xldn0384abc:XYZ123'
at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:546)
at com.ibm.mq.jms.MQConnection.createQM(MQConnection.java:1450)
at com.ibm.mq.jms.MQConnection.createQMNonXA(MQConnection.java:960)
at
. . .
com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2009
at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:172)
at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:270)
at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:290)

AMQERRO1.log
AMQ9513: Maximum number of channels reached.

Cause
The maximum number of channels that can be in use simultaneously has been reached. The number of permitted channels is a configurable parameter in the queue manager configuration file.
When this application connects to MQ a channel is started on the MQ side. If the application, for any reason, is unexpectedly disconnected (no proper disconnection takes place) then the channel will NOT get cleaned up on the MQ side. It will become 'orphaned' from its original parent connection. When the application reconnects it will get a new instance of the channel, so now there will be 2 instances of the channel, the new one and the old, orphaned instance.

MQ only allows a certain number of channels. If you build up enough channels you will get the MaxChannels error occurring here.

Channels may also be getting orphaned due to TCP/IP interruptions rather than an application disconnecting improperly from MQ.

Solution
How do we manage these orphaned channels?
If you can get these orphaned channels to clean up you will go a long way towards avoiding this issue.
Wait for some of the operating channels to close. Retry the operation when some channels are available.

The answer is TCP/IP KeepAlive.
You must enable KeepAlive at operating system (TCP/IP) level. How this is done depends entirely on the operating system you are using but your networking or System Admin people will probably know how to do this.

KeepAlive has a timeout option that is usually set to 2 hours. Recommend setting this to a much shorter interval, such as 10 minutes. Once this change has been made the OS will need to be rebooted for this to take effect.

In addition to enabling KeepAlive at the OS level, MQ must also be configured to use KeepAlive. This is done by adding the following stanza to the QM.INI file for this queue manager, as follows:
TCP:
KeepAlive=yes

Once this stanza has been added the queue manager must be restarted for this to take effect.

Lastly, it is highly recommend changing the MaxChannels value (also in the QM.INI file) to 3 times what you think may be needed. For instance from 100 to 300 MaxChannel. This will ensure that you have some 'elbow room' in the event a contingency occurs.





Document Information

Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Java Message Service (JMS)
Operating system(s): HP-UX
Software version: 4.0
Software edition:
Reference #: 1177012
IBM Group: Software Group
Modified date: Jun 28, 2005
(C) Copyright IBM Corporation 2000, 2006. All Rights Re


javax.jms.JMSException: MQJMS2005: failed to create MQQueueManager
Posted: Feb 27, 2006 03:37:31 AM   in response to: bonevichin response to: bonevich's post
Click to report abuse...

Click to reply to this thread
You can just start the listener on a different port:

runmqlsr -t tcp -p <port number goes here>

Or, if you prefer to start your listeners from runmqsc scripts:

DEFINE LISTENER('listener_name') TRPTYPE(TCP) PORT(<port number goes here>)
START LISTENER('listener_name')

Or you can change your existing listener with runmqsc:

ALTER LISTENER('existing_listener') PORT(<port number goes here>)

You probably need to restart the listener to see the changes:

STOP LISTENER('existing_listener')
START LISTENER('existing_listener')

Or, you can use the MQ v6 explorer GUI; the listeners are in the listeners
folder which is under the advanced folder of the queue manager you want to change.

Hope this helps,

Phil
  •  
·  To start the sender channels as background tasks using WebSphere MQ Explorer expand the queue manager, expand Advanced, and select Channels.
·  If you prefer, you can start listeners and channels as foreground tasks:
  1. To start a listener, enter the following command on the command line:
runmqlsr -t tcp -p 1414 -m WBRK_CONFIG_QM
  1. To start channels, enter the following commands:
c.  runmqchl -m WBRK_UNS_QM -c WBRK_UN_TO_BR
d.   
runmqchl -m WBRK_QM -c WBRK_BR_TO_UN

UNIX systems

  1. To start a listener enter the following command in a shell window:
runmqlsr -t tcp -p 1414 -m WBRK_QM
  1. To start a sender channel, enter the following command in a shell window:
runmqchl -c BROKER.CONFIG -m WBRK_QM
 
Commands to stop and start MQ listener 
 
  STOP LISTENER(listener_name)
STOP LISTENER(SYSTEM.DEFAULT.LISTENER.TCP)
     2 : STOP LISTENER(SYSTEM.DEFAULT.LISTENER.TCP)
AMQ8706: Request to stop WebSphere MQ Listener accepted.
start listener(SYSTEM.DEFAULT.LISTENER.TCP)
     3 : start listener(SYSTEM.DEFAULT.LISTENER.TCP)
AMQ8021: Request to start WebSphere MQ Listener accepted.


No comments:

Post a Comment