Wednesday, May 27, 2015

WebSphere MQ Multi-Instance Queue Managers Creations

Server1:
Create the logs and qmgrs directory in the shared file system:
# mkdir logs
# mkdir data
# chown -R mqm:mqm /mqha
# chmod -R ug+rwx /mqha
Create the queue manager:
# crtmqm -ld /mqha/log/ -md /mqha/data/ TEST
WebSphere MQ queue manager created.
Directory '/mqha/data/TEST' created.
The queue manager is associated with installation 'Installation1'.
Creating or replacing default objects for queue manager 'TEST'.
Default objects statistics : 74 created. 0 replaced. 0 failed.
Completing setup.
Setup completed.
#
Copy the queuemanager configuration details from Server1:
#  dspmqinf -o command TEST
Copy the output of the above command to Notepad. The output will be in the following format:
addmqinf -s QueueManager -v Name=TEST -v Directory=TEST -v Prefix=/var/mqm -v DataPath=/mqha/data/TEST


Server:2
Paste the output of the command was saved in Notepad in Step 4:
# addmqinf -s QueueManager -v Name=TEST -v Directory=TEST -v Prefix=/var/mqm -v DataPath=/mqha/data/TEST
WebSphere MQ configuration information added.
#
Start the active instance of queue manager on Server 1:
# strmqm -x TEST
WebSphere MQ queue manager 'TEST' starting.
The queue manager is associated with installation 'Installation1'.
5 log records accessed on queue manager 'TEST' during the log replay phase.
Log replay for queue manager 'TEST' complete.
Transaction manager state recovered for queue manager 'TEST'.
WebSphere MQ queue manager 'TEST' started using V7.5.0.2.
#
Start the standby instance of queue manager on Server 2:
# strmqm -x TEST
WebSphere MQ queue manager 'TEST' starting.
The queue manager is associated with installation 'Installation1'.
A standby instance of queue manager 'TEST' has been started. The active
instance is running elsewhere.
#
Verify the setup using dspmq -x:
On Server1 (stallion)
# dspmq -x
QMNAME(TEST) STATUS(Running)
INSTANCE(ausul3mq03.us.dell.com) MODE(Active)

#
On Server2 (saigon)
# dspmq -x
QMNAME(TEST) STATUS(Running as standby)
INSTANCE(ausul3mq03.us.dell.com) MODE(Active)
INSTANCE(ausul3mq04.us.dell.com) MODE(Standby)


**Testing - Creating a client auto-reconnect setup:
Create a local queue called TESTQ with defpsist(yes).
# DEF QL(TESTQ) DEFPSIST(YES)
DEF QL(TESTQ) DEFPSIST(YES)
AMQ8006: WebSphere MQ queue created.

Create a svrconn channel called TEST.SVRCONN.01.
# DEF CHL(TEST.SVRCONN.01) CHLTYPE(SVRCONN) TRPTYPE(TCP)
DEF CHL(TEST.SVRCONN.01) CHLTYPE(SVRCONN) TRPTYPE(TCP)
      DEF CHL(TEST.SVRCONN.01) CHLTYPE(SVRCONN) TRPTYPE(TCP)
AMQ8014: WebSphere MQ channel created.

Create a listener TCP.LSTR with port 9898
# Def lstr(TCP.LSTR) trptype(TCP) port(9898)
Def lstr(TCP.LSTR) trptype(TCP) port(9898)
AMQ8626: WebSphere MQ listener created.

# Start lstr(TCP.LSTR)
Start lstr(TCP.LSTR)
AMQ8021: Request to start WebSphere MQ listener accepted.

**Executing the client auto-reconnect samples
ON Server 1 : Invoke the amqsphac sample program:

# amqsphac TESTQ TEST

In another window on Server 1, end the queue manager with the "-is" option so that it will switch over to a standby queue manager:

#  endmqm -is TEST

Verify that a switchover has occurred: On Server2
# dspmq -x -o standby