HAClustered MQ
HAClustered MQ
Manager
W3Partnership have many years experience in the design development and implementation of Middleware
technologies, in particular IBM Middleware. We have a series of documents that look at a particular aspect of a
technology and how to implement the technology or improve a middleware design. To find more of our
documentation visit W3Partnership.com
In this article we will explain how to achieve a High Availability IBM MQ environment utilising a multi-instance queue
manager acting as a gateway to an MQ cluster, within a Unix-based (including Linux) or a Windows environment.
Introduction
When building a Production environment, one of the most important aspects for any client, is to ensure that the
environment is resilient, efficient and long-lasting. At the same time the administration of the environment should
be as easy as possible, as well as effective.
Cluster repository
A repository is a collection of information about the queue managers that are members of a cluster.
The repository information includes queue manager names, their locations, their channels, which queues they host,
and other information. The information is stored in the form of messages on a queue called SYSTEM.CLUSTER.
REPOSITORY.QUEUE. This queue is one of the default objects which is defined when an IBM MQ queue manager is
created.
Typically, two queue managers in a cluster hold a full repository; the remaining queue managers all hold a partial
repository.
Full repository and partial repository
A queue manager that hosts a complete set of information about every queue manager in the cluster has a full
repository. Other queue managers in the cluster have partial repositories containing a subset of the information in
the full repositories.
A partial repository contains information about only those queue managers with which the queue manager needs to
exchange messages. A queue manager will automatically request updates to the information they need, so that if it
changes, the full repository queue manager sends them the new information. For much of the time, a partial
repository contains all the information a queue manager needs to perform within the cluster. When a queue
manager needs some additional information, it makes inquiries of the full repository and updates its own partial
repository. The queue managers use a queue called SYSTEM.CLUSTER.COMMAND.QUEUE to request and receive
updates to the repositories. This queue is one of the default objects and is defined when you create an IBM MQ
queue manager.
This high level comparison should give an idea of which mode to use, but in order to make a sound decision it is
important that the costs and the probability of the risk that are involved are understood.
Full Repository
Now carry out the following instructions on Nodes 1 & 2 - this is Windows-centric but the same applies to Unix.
Node 1 Node 2
Log in with user who is a member of the local group mqm.
Create the following log and data directories in a folder
on an NFS drive, C:\MQHA, making sure that the owner is
a member of mqm, and mqm has full-control authority to
the folders.
C:\MQHA\data
C:\MQHA\log
Create a share called MQHA for C:\MQHA. The UNC Connect to \\hostname\MQHA
names are used to refer to the data and log folders – i.e.
\\hostname\MQHA\data and \\hostname\MQHA\log.
1
Once the queue manager has been created, issue the following command: dspmqinf –o command QMPRGW01. Copy the
results for use in the subsequent addmqinf command to be executed on Node 2.
2
SYSTEM.DEAD.LETTER.QUEUE is used as the “dead-letter queue”; this should be defined for the queue manager as required by
the installation
3
The logging parameters must be calculated according to the specific installation. The default values are shown in these
commands.
For Windows-based systems:
Node 1: crtmqm –sa -u SYSTEM.DEAD.LETTER.QUEUE -lc -lp 3 -ls 2 –lf 4096 –md \MQHA\data\QMPRGW01\ –ld
\MQHA\QMPRGW01\log QMPRGW01
Node 2: addmqinf –s QueueManager –v Name=QMPRGW01 –v Prefix=\var\mqm –v DataPath=\MQHA\QMPRGW01\data\QMPRGW01
–v Directory=QMPRGW01
-sa Automatic queue manager start-up - for Windows systems only. The queue manager is configured to start
automatically when the machine starts up, or more precisely, when the AMQMSRVN process starts up
-u The name of the local queue that is to be used as the dead-letter (undelivered-message) queue.
-lc Use circular logging4, (or -ll for linear logging, often preferable in Production environment)
-lp LogPrimaryFiles - the number of preallocated primary log files
-ls LogSecondaryFiles - the number of secondary log files that can be created for use when the primary log files
are full
-lf LogFilePages5 - the number of 4K pages for each primary and secondary log file
-md Command option for the location on the shared file system for the queue manager configuration data
-ld Command option for the location on the shared file system for the queue manager logs
4
The decision to have circular or linear logging is made during design and is dependent on the environment and system
involved.
5
The number of LogFilePages differs between environments and between systems. Calculations should be based on the logging
requirements of each implemented system. Details of calculations can be found here LogFilePages Calculations
DEFINE CHANNEL (CLUSNAME.QMPRGW01) CHLTYPE (CLUSSDR) CONNAME ('Node 1 (11414)') CLUSTER (CLUSNAME) REPLACE
ALTER QMGR REPOS ('CLUSNAME') REPOSNL (' ') MAXMSGL (104857600) PERFMEV (ENABLED) DEADQ ('SYSTEM.DEAD.LETTER.QUEUE')
Where:
CLUSNAME Example name for the IBM MQ Cluster
QMPRGW01 Example name for the IBM MQ Multi-instance queue manager
QMPRIB01/02 Example name for the IBM IIB queue managers
Conclusion
The above IBM MQ topology will provide a resilient, efficient and effective highly available clustered environment
and will allow for ease of administration and monitoring. The addition of the multi-instance queue managers will
allow for client reconnection assuming that connection details have been configured correctly and clients switch
between instances once the standby instance takes over.