0% found this document useful (0 votes)
100 views25 pages

Websphere MQ Multi Instance in V7.0.1: MW Coe - Ahs Middleware

Uploaded by

Minh Gia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
100 views25 pages

Websphere MQ Multi Instance in V7.0.1: MW Coe - Ahs Middleware

Uploaded by

Minh Gia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

MW CoE – AHS Middleware

WebSphere MQ
Multi Instance in v7.0.1

Gautam K Bhat
IBM India Pvt Ltd

© Copyright IBM Corporation 2003

© 2010 IBM Corporation


MW CoE – AHS Middleware

What is Multi-Instance?
As the name suggests it means having multiple instances of the same Queue
Manager

Applicable only from MQ v7.0.1

Multiple instances of same Queue manager exists on more than one server

 Only one instance of Queue Manager will be “Active” at a given time

 It is analogous to MQ HA Support pack MC63 / MC91

2 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

Multi Instance Operational View

3 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

Conceptual understanding of Multi Instance


 One active instance on one server and one or many standby instances on
other servers.
 Queue Manager logs and data files are stored in Shared (Network) storage.
 Out of many instances of Queue Manager, the one which is started first
becomes “Active” instance and all others are called “Stand by” instances.
 The first active instance obtains the lock on shared files.
 Any of the Stand by instance(s) can obtain the lock if the active instance goes
down either gracefully or unexpectedly.
 File locking is a very important requirement of Multi-instance concept. Proper &
timely (concurrency) file locking restricts only one instance of Queue Manager
to have access to its data and logs available in Storage at a given point of time.
 WebSphere MQ Clients and channels reconnect automatically to the standby
queue manager when it becomes active.
 Automatic client reconnect is not supported by WebSphere MQ classes for
Java

4 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

Pictorial Representation of Locking

 Queue Manager 1 Gains lock


on logs and data files  Queue Manager 2 Gains lock
on logs and data files

5 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

Platforms/OS Supported

 AIX
 Linux (32/64 bit)
 HP
 Windows
 Solaris

6 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

Platforms/OS Un Supported
 Z/OS (Mainframe)

7 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

MQ Commands related to Multi Instance


 amqmfsck (on Unix only) – Checks the shared file system (Networked Storage). It provides 3
options as parameter to the command
- No parameter checks basic locking
- -c parameter checks concurrent writing by two instances on two nodes simultaneously
- -w parameter checks acquiring lock and releasing lock by two instances on two nodes at the same time

 addmqinf – To add information to MQ configuration data. This command will copy configuration
data from a system where a queue manager is created to all other systems where Queue manager(s)
are to be started

 dspmqinf – Displays MQ configuration data


 rmvmqinf – Removes MQ configuration data
 crtmqm – creates Queue Manager
 strmqm – Starts the Queue Manager
 endmqm – Ends/Stops Queue Manager
 amqmdain (on Windows only) – Configures MQ Services control
 dspmq

8 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

Step by Step Implementation Process


 “mqm” user and group must be created. The uid/gid of mqm must be the same in all
nodes in Linux/Unix servers. The sid of user/group mqm on Windows must match on
Windows.
 Request for Shared Disk (say /MQHA) with appropriate space as per client standards
and full access to mqm user on all nodes (Shared disk preparation is out of MQ
administrator’s scope)
 Login as “mqm” user on the primary node (server)
 Create the Queue Manager as shown below
- crtmqm -md /MQHA/data -ld /MQHA/log QM1
 Run dspmqinf command on the same node
- dspmqinf -o command QM1
 Create another instance of Queue Manager on another node (server)
- addmqinf -s QueueManager -v Name=QM1 -v Directory=QM1 -v Prefix=/var/mqm -v
DataPath=/MQHA/data/QM1
 Run amqmfsck to test the Storage file system
- amqmfsck /MQHA/data
- amqmfsck -c /MQHA/data
- amqmfsck -w /MQHA/data

9 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

Step by Step Implementation Process Cont…


 Start the Queue Manager (if it is the one first to be started, it becomes active
instance)
- strmqm –x QM1
 Start the Queue Manager (if it is not the first one to be started, then it becomes
stand by instance)
 View the status of multi instance Queue Manager
- dspmq
 The status of multi instance Queue Manager can be one of the following

10 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

HA - File System Organization

11 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

Comparison between MC63/61 and Multi Instance commands

12 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

References

 Introduction to MQ Multi Instance by Barry Robbins


 Redbook - sg247839, Chapter 6 (Using Multi-instances Queue Managers and
Brokers for High Availability)
 IBM Information Center -
http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=/com.ibm.mq.amqzag.doc/fa701
59_.htm

13 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

Lab Implementation on Unix

14 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

Mounting the file System


 Using Smitty in AIX

15 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

Performing checks on File System Lock

 amqmfsck /HA on Primary server (10.7.0.126)

 amqmfsck –c /HA on Primary server

 amqmfsck –c /HA on Secondary server (10.7.0.127)

16 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

Performing checks on File System Lock


 amqmfsck –wv /HA/MQDATA on Primary server (10.7.0.126)

 amqmfsck –wv /HA/MQDATA on 10.7.0.127 (Waiting message keeps repeating)

17 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

Performing checks on File System Lock


 Press ENTER on Primary server (10.7.0.126)

 On pressing ENTER on 10.7.0.126, File Lock released message appears on the server and File Lock
Acquired message appears on 10.7.0.127 as shown below

18 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

Creating Shared Directory & Creating Queue Manager


 Create the logs and qmgrs directory in the shared file system

 Create the Queue Manager as Multi Instance QM


crtmqm -ld /HA/logs -md /HA/qmgrs -q COE

19 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

Creating & starting Multi Instance Queue Manager


 Copy the queue manager configuration details from Server1
dspmqinf -o command COE

 Paste the above output on the Secondary Server

 Start the active instance of queue manager on Server 1


- Strmqm –x COE

20 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

Creating, Starting & Verifying Multi Instance Queue Manager


 Start the standby instance of queue manager on Server 2
- strmqm -x COE

 Verify the setup using dspmq –x on Primary Server

 Verify the setup using dspmq –x on Secondary Server

21 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

Back Up Slides

22 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

Client Reconnect Feature


 Set MQSERVER environment variable with IP’s of both Primary & Secondary servers where Multi
Instance Queue managers reside.

 Invoke the amqsphac sample program on Primary server

 In another window (new session) on Primary server, end the queue manager with the -is option so that it
will switch over to a standby queue manager:

23 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

Client Reconnect Feature cont …


 Old Session of Primary Server - The connection will break and a reconnection will occur on the standby
queue manager.

 Run the sample program amsghac on Server 1 (o same old session – NOT on NEW SESSION) to get
the messages

24 © Copyright IBM Corporation 2010


MW CoE – AHS Middleware

ThankYou!!!
Thank You!

25 © Copyright IBM Corporation 2010

You might also like