8/19/10

My MQ Notes

Installed MQM on RHEL 5.
first created uid:mqm, gid:mqm
Downloaded WMQ linux gz file.
Copied to /tmp/mqinst
tar -zxvf gz file

su

./mqlicense.sh -accept

Then kick start to install

rpm -ivh MQSeriesServer, runtimes yata yata yata



1. create a default q manager
call it MQ.QM1
[mqm@localhost ~]$ crtmqm MQ.QM1
There are 90 days left in the trial period for this copy of WebSphere MQ.
WebSphere MQ queue manager created.
Creating or replacing default objects for MQ.QM1.
Default objects statistics : 40 created. 0 replaced. 0 failed.
Completing setup.
Setup completed.


2. Start Q Manager

[mqm@localhost ~]$ strmqm MQ.QM1
There are 90 days left in the trial period for this copy of WebSphere MQ.
WebSphere MQ queue manager 'MQ.QM1' starting.
5 log records accessed on queue manager 'MQ.QM1' during the log replay phase.
Log replay for queue manager 'MQ.QM1' complete.
Transaction manager state recovered for queue manager 'MQ.QM1'.
WebSphere MQ queue manager 'MQ.QM1' started.

Note :
[mqm@localhost ~]$ ps -ef | grep mqm
root 6040 6024 0 12:12 pts/1 00:00:00 su - mqm
mqm 6043 6040 0 12:12 pts/1 00:00:00 -bash
mqm 6418 1 0 12:22 ? 00:00:00 amqzxma0 -m MQ.QM1
mqm 6422 6418 0 12:22 ? 00:00:00 /opt/mqm/bin/amqzfuma -m MQ.QM1
mqm 6424 6418 0 12:22 ? 00:00:00 amqzmuc0 -m MQ.QM1
mqm 6429 6418 0 12:22 ? 00:00:00 amqzmur0 -m MQ.QM1
mqm 6432 6418 0 12:22 ? 00:00:00 /opt/mqm/bin/amqrrmfa -m MQ.QM1 -t2332800 -s2592000 -p2592000 -g5184000 -c3600
mqm 6434 6418 0 12:22 ? 00:00:00 /opt/mqm/bin/amqzdmaa -m MQ.QM1
mqm 6436 6418 0 12:22 ? 00:00:00 /opt/mqm/bin/amqzmgr0 -m MQ.QM1
mqm 6449 6418 0 12:22 ? 00:00:00 amqzlaa0 -mMQ.QM1 -fip0
mqm 6450 6436 0 12:22 ? 00:00:00 /opt/mqm/bin/runmqchi -m MQ.QM1 -r
mqm 6452 6436 0 12:22 ? 00:00:00 /opt/mqm/bin/amqpcsea MQ.QM1
mqm 6482 6043 0 12:22 pts/1 00:00:00 ps -ef
mqm 6483 6043 0 12:22 pts/1 00:00:00 grep mqm


What are these amqzlaa0 -mMQ.QM1 -fip0
runmqxhi
amqzmqr0
amqzfuma
------------------------
3. Once QM starts, create local queues using script.
Use the control commands interactively
Use the control command runmqsc to perform the following tasks. Enter all the
WebSphere MQ commands interactively and display the results at the terminal.

[mqm@localhost errors]$ runmqsc
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
AMQ8146: WebSphere MQ queue manager not available.

No MQSC commands read.
No commands have a syntax error.
All valid MQSC commands were processed.
[mqm@localhost errors]$

As MQ.QM1 is not set as the default queue manager, runmqsc is returning back stating, hey, WebSphere MQ queue manager not available.

To further dig into this, verified logs at -
i./var/mqm/errors/AMQERR01.LOG
ii. /var/mqm/qmgrs/MQ!QM1/errors/AMQERR01.LOG
In the above i. being the mq error log and ii. being the queue manager error log.

There is this MQ configuration file called mqs.ini, default location is /var/mqm
My mqs.ini is like this -
-----------------------------
AllQueueManagers:
#********************************************************************#
#* The path to the qmgrs directory, below which queue manager data *#
#* is stored *#
#********************************************************************#
DefaultPrefix=/var/mqm

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

LogDefaults:
LogPrimaryFiles=3
LogSecondaryFiles=2
LogFilePages=1024
LogType=CIRCULAR
LogBufferPages=0
LogDefaultPath=/var/mqm/log


QueueManager:
Name=MQ.QM1
Prefix=/var/mqm
Directory=MQ!QM1
-----------------------------

In the content, there is no listing of default queue manager....
looked in IBM MQ InfoCenter and a sample file looked like this -
-----------------------------
AllQueueManagers:
#***********************************************************************#
#* The path to the qmgrs directory, below which queue manager data *#
#* is stored *#
#***********************************************************************#
DefaultPrefix=/var/mqm

LogDefaults:
LogPrimaryFiles=3
LogSecondaryFiles=2
LogFilePages=1024
LogType=CIRCULAR
LogBufferPages=0
LogDefaultPath=/var/mqm/log

QueueManager:
Name=saturn.queue.manager
Prefix=/var/mqm
Directory=saturn!queue!manager

QueueManager:
Name=pluto.queue.manager
Prefix=/var/mqm
Directory=pluto!queue!manager

DefaultQueueManager:
Name=saturn.queue.manager

ApiExitTemplate:
Name=OurPayrollQueueAuditor
Sequence=2
Function=EntryPoint
Module=/usr/ABC/auditor
Data=123

ApiExitCommon:
Name=MQPoliceman
Sequence=1
Function=EntryPoint
Module=/usr/MQPolice/tmqp
Data=CheckEverything
-----------------------------

So let me edit my file with appropriate default queue settings -
Just added these two lines at the end of the file -
DefaultQueueManager:
Name=MQ.QM1

Now the changes comes into action only after restarting the queue manager.
How to restart the queue manager?
Search in MQ info center - says, ps -ef | grep QNAME lists all the available processes, pick the queue manager process and kill -9.
Wow...
Let me see what I got here -
[mqm@localhost mqm]$ ps -ef | grep mqm | grep -i qm1
mqm 6418 1 0 12:22 ? 00:00:00 amqzxma0 -m MQ.QM1
mqm 6422 6418 0 12:22 ? 00:00:00 /opt/mqm/bin/amqzfuma -m MQ.QM1
mqm 6424 6418 0 12:22 ? 00:00:00 amqzmuc0 -m MQ.QM1
mqm 6429 6418 0 12:22 ? 00:00:00 amqzmur0 -m MQ.QM1
mqm 6432 6418 0 12:22 ? 00:00:00 /opt/mqm/bin/amqrrmfa -m MQ.QM1 -t2332800 -s2592000 -p2592000 -g5184000 -c3600
mqm 6434 6418 0 12:22 ? 00:00:00 /opt/mqm/bin/amqzdmaa -m MQ.QM1
mqm 6436 6418 0 12:22 ? 00:00:00 /opt/mqm/bin/amqzmgr0 -m MQ.QM1
mqm 6449 6418 0 12:22 ? 00:00:00 amqzlaa0 -mMQ.QM1 -fip0
mqm 6450 6436 0 12:22 ? 00:00:00 /opt/mqm/bin/runmqchi -m MQ.QM1 -r
mqm 6452 6436 0 12:22 ? 00:00:00 /opt/mqm/bin/amqpcsea MQ.QM1
mqm 13218 7791 0 13:34 pts/1 00:00:00 grep -i qm1

pid 6418 is the parent pid for all these process.
kill -9 6418 :)

Yeah,
[mqm@localhost mqm]$ ps -ef | grep mqm | grep -i qm1
mqm 13397 7791 0 13:39 pts/1 00:00:00 grep -i qm1

So, good to go now, start queue manager now

[mqm@localhost mqm]$ strmqm
There are 90 days left in the trial period for this copy of WebSphere MQ.
WebSphere MQ queue manager 'MQ.QM1' starting.
17 log records accessed on queue manager 'MQ.QM1' during the log replay phase.
Log replay for queue manager 'MQ.QM1' complete.
Transaction manager state recovered for queue manager 'MQ.QM1'.
WebSphere MQ queue manager 'MQ.QM1' started.

I have not mentioned the FQQMN (Fully Qualified Queue Manager Name), it picked the MQ.QM1 as default and start the manager.
Now, lets check runmqsc
:):)
[mqm@localhost mqm]$ runmqsc
5724-H72 (C) Copyright IBM Corp. 1994, 2005. ALL RIGHTS RESERVED.
Starting MQSC for queue manager MQ.QM1.




Its waiting for my interactive command.
:):)


__ a. Display all the attributes of the queue manager.
DISPLAY QMGMR
1 : DISPLAY QMGMR
AMQ8405: Syntax error detected at or near end of command segment below:-
DISPLAY QMG

AMQ8427: Valid syntax for the MQSC command:

DISPLAY QMODEL(generic_q_name)

[ WHERE( filter_keyword operator filter_value ) ]

[ ALL ] [ ALTDATE ] [ ALTTIME ] [ BOTHRESH ] [ BOQNAME ]
[ CRDATE ] [ CRTIME ] [ DEFPRTY ] [ DEFPSIST ] [ DEFSOPT ]
[ DEFTYPE ] [ DESCR ] [ DISTL ] [ GET ] [ HARDENBO ]
[ INITQ ] [ MAXDEPTH ] [ MAXMSGL ] [ MSGDLVSQ ] [ PROCESS ]
[ PUT ] [ QDEPTHHI ] [ QDEPTHLO ] [ QDPHIEV ] [ QDPLOEV ]
[ QDPMAXEV ] [ QSVCIEV ] [ QSVCINT ] [ QTYPE ] [ RETINTVL ]
[ SHARE ] [ TRIGDATA ] [ TRIGDPTH ] [ TRIGGER ] [ TRIGMPRI ]
[ TRIGTYPE ] [ TYPE ] [ USAGE ] [ NPMCLASS ] [ MONQ ]
[ ACCTQ ] [ STATQ ]
DISPLAY Q
2 : DISPLAY Q
AMQ8405: Syntax error detected at or near end of command segment below:-
DISPLAY Q

AMQ8427: Valid syntax for the MQSC command:

DISPLAY QUEUE(generic_q_name)

[ WHERE( filter_keyword operator filter_value ) ]

[ CLUSTER(generic_cluster_name) ] [ CLUSNL(generic_namelist_name) ]
[ TYPE( QALIAS | QCLUSTER | QLOCAL | QMODEL | QREMOTE ) ]
[ ALL ] [ ALTDATE ] [ ALTTIME ] [ BOTHRESH ]
[ BOQNAME ] [ CLUSDATE ] [ CLUSINFO ] [ CLUSNL ] [ CLUSQMGR ]
[ CLUSQT ] [ CLUSTER ] [ CLUSTIME ] [ CRDATE ] [ CRTIME ]
[ CURDEPTH ] [ DEFBIND ] [ DEFPRTY ] [ DEFPSIST ] [ DEFSOPT ]
[ DEFTYPE ] [ DESCR ] [ DISTL ] [ GET ] [ HARDENBO ]
[ INITQ ] [ IPPROCS ] [ MAXDEPTH ] [ MAXMSGL ] [ MSGDLVSQ ]
[ OPPROCS ] [ PROCESS ] [ PUT ] [ QDEPTHHI ] [ QDEPTHLO ]
[ QDPHIEV ] [ QDPLOEV ] [ QDPMAXEV ] [ QMID ] [ QSVCIEV ]
[ QSVCINT ] [ QTYPE ] [ RETINTVL ] [ RNAME ] [ RQMNAME ]
[ SCOPE ] [ SHARE ] [ TARGQ ] [ TRIGDATA ] [ TRIGDPTH ]
[ TRIGGER ] [ TRIGMPRI ] [ TRIGTYPE ] [ TYPE ] [ USAGE ]
[ XMITQ ] [ MONQ ] [ CLWLRANK ] [ CLWLPRTY ] [ CLWLUSEQ ]


__ b. List the names of all the queues whose names begin with the characters
"SYSTEM".
DISPLAY Q(SYSTEM*)
3 : DISPLAY Q(SYSTEM*)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.ADMIN.ACCOUNTING.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.ADMIN.ACTIVITY.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.ADMIN.CHANNEL.EVENT) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.ADMIN.COMMAND.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.ADMIN.LOGGER.EVENT) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.ADMIN.PERFM.EVENT) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.ADMIN.QMGR.EVENT) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.ADMIN.STATISTICS.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.ADMIN.TRACE.ROUTE.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.AUTH.DATA.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.CHANNEL.INITQ) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.CHANNEL.SYNCQ) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.CICS.INITIATION.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.CLUSTER.COMMAND.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.CLUSTER.REPOSITORY.QUEUE)
TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.CLUSTER.TRANSMIT.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.DEAD.LETTER.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.DEFAULT.ALIAS.QUEUE) TYPE(QALIAS)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.DEFAULT.INITIATION.QUEUE)
TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.DEFAULT.LOCAL.QUEUE) TYPE(QLOCAL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.DEFAULT.MODEL.QUEUE) TYPE(QMODEL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.DEFAULT.REMOTE.QUEUE) TYPE(QREMOTE)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.MQEXPLORER.REPLY.MODEL) TYPE(QMODEL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.MQSC.REPLY.QUEUE) TYPE(QMODEL)
AMQ8409: Display Queue details.
QUEUE(SYSTEM.PENDING.DATA.QUEUE) TYPE(QLOCAL)


__ c. Create a local queue QL.A. Its definitions should include a text description.

DEFINE QL(QL.A)
4 : DEFINE QL(QL.A)
AMQ8006: WebSphere MQ queue created.
I forgot to add description. What to do?
ALTER QL(QL.A) DESCR ('QL.A QUEUE A BLAH')
6 : ALTER QL(QL.A) DESCR ('QL.A QUEUE A BLAH')
AMQ8008: WebSphere MQ queue changed.

__ d. Display all the attributes of the queue.

DISPLAY QL(QL.A)
9 : DISPLAY QL(QL.A)
AMQ8409: Display Queue details.
QUEUE(QL.A) TYPE(QLOCAL)
ACCTQ(QMGR) ALTDATE(2010-08-18)
ALTTIME(13.52.49) BOQNAME( )
BOTHRESH(0) CLUSNL( )
CLUSTER( ) CLWLPRTY(0)
CLWLRANK(0) CLWLUSEQ(QMGR)
CRDATE(2010-08-18) CRTIME(13.50.05)
CURDEPTH(0) DEFBIND(OPEN)
DEFPRTY(0) DEFPSIST(NO)
DEFSOPT(SHARED) DEFTYPE(PREDEFINED)
DESCR(QL.A QUEUE A BLAH) DISTL(NO)
GET(ENABLED) HARDENBO
INITQ( ) IPPROCS(0)
MAXDEPTH(5000) MAXMSGL(4194304)
MONQ(QMGR) MSGDLVSQ(PRIORITY)
NOTRIGGER NPMCLASS(NORMAL)
OPPROCS(0) PROCESS( )
PUT(ENABLED) QDEPTHHI(80)
QDEPTHLO(20) QDPHIEV(DISABLED)
QDPLOEV(DISABLED) QDPMAXEV(ENABLED)
QSVCIEV(NONE) QSVCINT(999999999)
RETINTVL(999999999) SCOPE(QMGR)
SHARE STATQ(QMGR)
TRIGDATA( ) TRIGDPTH(1)
TRIGMPRI(0) TRIGTYPE(FIRST)
USAGE(NORMAL)

__ e. Change the maximum number of messages allowed on the queue to 1000.

We need to change the maximum number of messages allowed to 1000.
MAXIMUM NUMBER OF MESSAGES is nothing but maxdepth

ALTER QL(QL.A) MAXDEPTH(1000)
10 : ALTER QL(QL.A) MAXDEPTH(1000)
AMQ8008: WebSphere MQ queue changed.

In the above maxdepth is MAXDEPTH(5000)

__ f. Again display the queue attributes. Was the modification successful and is the
queue description unchanged?
• DISPLAY QL(QL.A)
DISPLAY QL(QL.A)
1 : DISPLAY QL(QL.A)
AMQ8409: Display Queue details.
QUEUE(QL.A) TYPE(QLOCAL)
ACCTQ(QMGR) ALTDATE(2010-08-18)
ALTTIME(13.55.59) BOQNAME( )
BOTHRESH(0) CLUSNL( )
CLUSTER( ) CLWLPRTY(0)
CLWLRANK(0) CLWLUSEQ(QMGR)
CRDATE(2010-08-18) CRTIME(13.50.05)
CURDEPTH(0) DEFBIND(OPEN)
DEFPRTY(0) DEFPSIST(NO)
DEFSOPT(SHARED) DEFTYPE(PREDEFINED)
DESCR(QL.A QUEUE A BLAH) DISTL(NO)
GET(ENABLED) HARDENBO
INITQ( ) IPPROCS(0)
MAXDEPTH(1000) MAXMSGL(4194304)
MONQ(QMGR) MSGDLVSQ(PRIORITY)
NOTRIGGER NPMCLASS(NORMAL)
OPPROCS(0) PROCESS( )
PUT(ENABLED) QDEPTHHI(80)
QDEPTHLO(20) QDPHIEV(DISABLED)
QDPLOEV(DISABLED) QDPMAXEV(ENABLED)
QSVCIEV(NONE) QSVCINT(999999999)
RETINTVL(999999999) SCOPE(QMGR)
SHARE STATQ(QMGR)
TRIGDATA( ) TRIGDPTH(1)
TRIGMPRI(0) TRIGTYPE(FIRST)
USAGE(NORMAL)


__ g. Define a second local queue QL.B with a text description.

DEFINE QL(QL.B)
5 : DEFINE QL(QL.B)
AMQ8006: WebSphere MQ queue created.

__ h. Display all the attributes of the queue.
• DISPLAY QL(QL.B)
DISPLAY QL(QL.B)
3 : DISPLAY QL(QL.B)
AMQ8409: Display Queue details.
QUEUE(QL.B) TYPE(QLOCAL)
ACCTQ(QMGR) ALTDATE(2010-08-18)
ALTTIME(13.58.55) BOQNAME( )
BOTHRESH(0) CLUSNL( )
CLUSTER( ) CLWLPRTY(0)
CLWLRANK(0) CLWLUSEQ(QMGR)
CRDATE(2010-08-18) CRTIME(13.50.16)
CURDEPTH(0) DEFBIND(OPEN)
DEFPRTY(0) DEFPSIST(NO)
DEFSOPT(SHARED) DEFTYPE(PREDEFINED)
DESCR(QL.B B QUEUE BLAH) DISTL(NO)
GET(ENABLED) HARDENBO
INITQ( ) IPPROCS(0)
MAXDEPTH(5000) MAXMSGL(4194304)
MONQ(QMGR) MSGDLVSQ(PRIORITY)
NOTRIGGER NPMCLASS(NORMAL)
OPPROCS(0) PROCESS( )
PUT(ENABLED) QDEPTHHI(80)
QDEPTHLO(20) QDPHIEV(DISABLED)
QDPLOEV(DISABLED) QDPMAXEV(ENABLED)
QSVCIEV(NONE) QSVCINT(999999999)
RETINTVL(999999999) SCOPE(QMGR)
SHARE STATQ(QMGR)
TRIGDATA( ) TRIGDPTH(1)
TRIGMPRI(0) TRIGTYPE(FIRST)
USAGE(NORMAL)

__ i. Change the maximum number of messages allowed on the queue to 2000 this
time using -DEFINE with REPLACE- instead of the -ALTER- command.
DEFINE QL(QL.B) REPLACE MAXDEPTH(2000)
4 : DEFINE QL(QL.B) REPLACE MAXDEPTH(2000)
AMQ8006: WebSphere MQ queue created.


__ j. Display again the queue attributes of QL.B. Was the creation of the queue
successful and is there a queue description?

DISPLAY QL(QL.B)
5 : DISPLAY QL(QL.B)
AMQ8409: Display Queue details.
QUEUE(QL.B) TYPE(QLOCAL)
ACCTQ(QMGR) ALTDATE(2010-08-18)
ALTTIME(14.12.18) BOQNAME( )
BOTHRESH(0) CLUSNL( )
CLUSTER( ) CLWLPRTY(0)
CLWLRANK(0) CLWLUSEQ(QMGR)
CRDATE(2010-08-18) CRTIME(13.50.16)
CURDEPTH(0) DEFBIND(OPEN)
DEFPRTY(0) DEFPSIST(NO)
DEFSOPT(SHARED) DEFTYPE(PREDEFINED)
DESCR( ) DISTL(NO)
GET(ENABLED) HARDENBO
INITQ( ) IPPROCS(0)
MAXDEPTH(2000) MAXMSGL(4194304)
MONQ(QMGR) MSGDLVSQ(PRIORITY)
NOTRIGGER NPMCLASS(NORMAL)
OPPROCS(0) PROCESS( )
PUT(ENABLED) QDEPTHHI(80)
QDEPTHLO(20) QDPHIEV(DISABLED)
QDPLOEV(DISABLED) QDPMAXEV(ENABLED)
QSVCIEV(NONE) QSVCINT(999999999)
RETINTVL(999999999) SCOPE(QMGR)
SHARE STATQ(QMGR)
TRIGDATA( ) TRIGDPTH(1)
TRIGMPRI(0) TRIGTYPE(FIRST)
USAGE(NORMAL)
__ 4. Exit the runmqsc mode

END is the command to exit the runmqsc.

No comments: