IBM MQ Setup - Step by step
IBM MQ Setup - Step by step
Before starting to install-uninstall, end all WebSphere MQ activity.
1. Log on as a user in group mqm.
2. Use the dspmq command to display the state of all the queue managers on the system.
3. Use the endmqm command to stop all running queue managers.
4. Stop any listeners associated with the queue managers, using the command: endmqlsr -m QMgrName
5. To check that you have stopped all of them, enter the following: ps -ef | grep mq
Check that there are no processes listed that are running command
lines beginning amq or runmq.
Ignore any that start with amqi.
List of commands:
crtmqm -q MYQM
strmqm MYQM
runmqsc MYQM
define qlocal (MYQUEUE)
DEFINE LISTENER('LISTENER.TCP') TRPTYPE(TCP) PORT(1415) CONTROL(QMGR)
ALTER LISTENER('LISTENER.TCP') TRPTYPE(TCP) PORT(1415) CONTROL(QMGR)
end
runmqsc MYQM
$ sudo -su root
# pwd
/usr/mqm/bin
# crtmqm -q MYQM
WebSphere MQ queue manager created.
Directory '/var/mqm/qmgrs/MYQM' created.
The queue manager is associated with installation 'Installation1'.
Creating or replacing default objects for queue manager 'MYQM'.
Default objects statistics : 74 created. 0 replaced. 0 failed.
Completing setup.
Setup completed.
#
#
# strmqm
WebSphere MQ queue manager 'MYQM' starting.
The queue manager is associated with installation 'Installation1'.
5 log records accessed on queue manager 'MYQM' during the log replay phase.
Log replay for queue manager 'MYQM' complete.
Transaction manager state recovered for queue manager 'MYQM'.
WebSphere MQ queue manager 'MYQM' started using V7.5.0.1.
#
#
# dspmq
QMNAME(MYQM) STATUS(Running)
QMNAME(SATURN.QUEUE.MANAGER) STATUS(Ended unexpectedly)
QMNAME(OTHERQM) STATUS(Running)
# strmqm SATURN.QUEUE.MANAGER
WebSphere MQ queue manager 'SATURN.QUEUE.MANAGER' starting.
The queue manager is associated with installation 'Installation1'.
9 log records accessed on queue manager 'SATURN.QUEUE.MANAGER' during the log replay phase.
Log replay for queue manager 'SATURN.QUEUE.MANAGER' complete.
Transaction manager state recovered for queue manager 'SATURN.QUEUE.MANAGER'.
WebSphere MQ queue manager 'SATURN.QUEUE.MANAGER' started using V7.5.0.1.
#
#
#
# dspmq
QMNAME(OTHERQM) STATUS(Running)
QMNAME(SATURN.QUEUE.MANAGER) STATUS(Running)
QMNAME(MYQM) STATUS(Running)
#
#
# runmqsc MYQM
5724-H72 (C) Copyright IBM Corp. 1994, 2011. ALL RIGHTS RESERVED.
Starting MQSC for queue manager MYQM.
define qlocal (MYQUEUE)
1 : define qlocal (MYQUEUE)
AMQ8006: WebSphere MQ queue created.
end
2 : end
One MQSC command read.
No commands have a syntax error.
All valid MQSC commands were processed.
#
-------------------------------------------------------------------------------
Create a Queue Manager$ crtmqm MYQM
Delete a Queue Manager
$ dltmqm MYQM
Start Queue Manager
$ strmqm MYQM
Stopping Queue Manager
Wait for queue manager to shutdown
$ endmqm -w MYQM
End Immediately
$ endmqm -i MYQM
endmqm MYQM
Start Queue Manager (Init Script)
By default Websphere MQ does not ship with an init script, you can add this functionality via a support pac (MSL1) provided by IBM.
$ service ibm.com-WebSphere_MQ start
Stopping Queue Manager (Init Script)
$ service ibm.com-WebSphere_MQ stop
Start MQ Listener
$ echo "start LISTENER(SYSTEM.DEFAULT.LISTENER.TCP)" | runmqsc MYQM
Stop MQ Listener
$ echo "stop LISTENER(SYSTEM.DEFAULT.LISTENER.TCP)" | runmqsc MYQM
Display Queue Managers & Status
$ dspmq
Set MQ Privileges
In order for a Unix user to start utilizing MQ they must have the appropriate privileges. You can find the available privileges in IBM's Documentation.
Set MQ Privileges By User
$ dspmq
Set MQ Privileges
In order for a Unix user to start utilizing MQ they must have the appropriate privileges. You can find the available privileges in IBM's Documentation.
Set MQ Privileges By User
$ setmqaut -m MYQM -t qmgr -p mqm +all
Set MQ Privileges By Groups
Set MQ Privileges By Groups
$ setmqaut -m MYQM -t qmgr -g REPLACE_GROUP REPLACE_PLUS_OR_MINUS_PRIVILEGE
Display MQ Privileges
Display MQ Privileges By Users
$ dspmqaut -m MYQM -t qmgr -p mqm
Display MQ Privileges By Groups
$ dspmqaut -m MYQM -t qmgr -g REPLACE_GROUP
Lookup MQ Error Numbers
$ mqrc REPLACE_ERROR_NUM
MQ Sample Scripts
Within the MQ release by IBM there is a package that contains sample scripts for MQ. There are about 3 of these sample scripts that I have found pretty useful.
Pop (GET) Messages off a queue
$ amqsget REPLACE_Q_NAME MYQM
This command will remove messages from the queue, only use this if you no longer want the messages in the queue.
Browse Messages in a queue
$ amqsbcg REPLACE_Q_NAME MYQM
Open a Queue for writing
$ amqsput REPLACE_Q_NAME MYQM
When you find yourself with a system that is connected to a repository but doesn't see new messages you can try opening the queue for writing with amqsput to “refresh” the connectivity. You do not have to write anything to the queue. Simply open the queue and press ctrl+d without typing any additional characters.
Open Websphere MQ CLI
$ runmqsc MYQM
Websphere MQ CLI Commands
The following commands are to be run directly from the MQ command line interface.
Start MQ Listener
start LISTENER(SYSTEM.DEFAULT.LISTENER.TCP)
Stop MQ Listener
stop LISTENER(SYSTEM.DEFAULT.LISTENER.TCP)
stop LISTENER(SYSTEM.DEFAULT.LISTENER.TCP)
Disable Channel Authentication
alter qmgr chlauth(disabled)
Channel Authentication is new as of MQ 7.0. If your systems don't use it you can simply turn it off.
alter qmgr chlauth(disabled)
Channel Authentication is new as of MQ 7.0. If your systems don't use it you can simply turn it off.
Display Queues
All Queues
display queue(*)
Specific Queues
display queue(REPLACE_Q_NAME)
Short hand
dis q(REPLACE_Q_NAME)
Display Local Queues only
All Queues
display qlocal(*)
Specific Queue
display qlocal(REPLACE_Q_NAME)
Short hand
dis ql(REPLACE_Q_NAME)
Display Alias Queues only
All Queues
display qalias(*)
Specific Queue
display qalias(REPLACE_Q_NAME)
Short hand
dis qa(REPLACE_Q_NAME)
Display Cluster Queues only
All Queues
display qcluster(*)
Specific Queue
display qcluster(REPLACE_Q_NAME)
Short hand
dis qc(REPLACE_Q_NAME)
Display Channels
All Channels
display channel(*)
Specific Channel
display channel(REPLACE_CHANNEL_NAME)
Short hand
dis channel(REPLACE_CHANNEL_NAME)
Display Channel Status
All Channels
display chstatus(*)
Specific Channel
display chstatus(REPLACE_CHANNEL_NAME)
Short hand
dis chstatus(REPLACE_CHANNEL_NAME)
Display Local Queue Manager Information
display qmgr
Display Cluster Queue Manager Information
display clusqmgr(REPLACE_CLUSQMGR_NAME)
Show number of INPUT and OUTPUT threads open
display qstatus(REPLACE_Q_NAME) IPPROCS OPPROCS
Find Process ID of Processes Accessing Queue
display qstatus(REPLACE_Q_NAME) TYPE(HANDLE) ALL
Refresh Cluster Queue Manager
refresh cluster(REPLACE_CLUSQMGR_NAME)
Start Channel
start channel(REPLACE_CHANNEL_NAME)
All Queues
display queue(*)
Specific Queues
display queue(REPLACE_Q_NAME)
Short hand
dis q(REPLACE_Q_NAME)
Display Local Queues only
All Queues
display qlocal(*)
Specific Queue
display qlocal(REPLACE_Q_NAME)
Short hand
dis ql(REPLACE_Q_NAME)
Display Alias Queues only
All Queues
display qalias(*)
Specific Queue
display qalias(REPLACE_Q_NAME)
Short hand
dis qa(REPLACE_Q_NAME)
Display Cluster Queues only
All Queues
display qcluster(*)
Specific Queue
display qcluster(REPLACE_Q_NAME)
Short hand
dis qc(REPLACE_Q_NAME)
Display Channels
All Channels
display channel(*)
Specific Channel
display channel(REPLACE_CHANNEL_NAME)
Short hand
dis channel(REPLACE_CHANNEL_NAME)
Display Channel Status
All Channels
display chstatus(*)
Specific Channel
display chstatus(REPLACE_CHANNEL_NAME)
Short hand
dis chstatus(REPLACE_CHANNEL_NAME)
Display Local Queue Manager Information
display qmgr
Display Cluster Queue Manager Information
display clusqmgr(REPLACE_CLUSQMGR_NAME)
Show number of INPUT and OUTPUT threads open
display qstatus(REPLACE_Q_NAME) IPPROCS OPPROCS
Find Process ID of Processes Accessing Queue
display qstatus(REPLACE_Q_NAME) TYPE(HANDLE) ALL
Refresh Cluster Queue Manager
refresh cluster(REPLACE_CLUSQMGR_NAME)
Start Channel
start channel(REPLACE_CHANNEL_NAME)
Comments
Post a Comment