An example shows how to set up a multi-instance queue manager on Linux. The setup is small to illustrate the concepts involved. The example is based on Linux Red Hat Enterprise 5. The steps differ on other UNIX platforms.
The example is set up on a 2 GHz notebook computer with 3 GB RAM running Windows. Two VMware virtual machines run Linux Red Hat Enterprise 5 in 640 MB images. A WebSphere® MQ client is installed on an additional 400 MB VMware image that runs Windows and runs the sample high availability applications. All the virtual machines are configured as part of a VMware host-only network for security reasons. Although it is generally recommended not to use an automatically generated IP address, it is acceptable to use one for a short demonstration, because the IP address is unlikely to change.
Server 1 | Server 2 |
---|---|
Log in as root | |
Follow the instructions in WebSphere MQ Quick Beginnings for Linux to install WebSphere MQ, create the mqm user and group, and define /var/mqm. | |
Carry out the task, Verifying shared file system locking to check the file system supports multi-instance queue managers. | |
Check what uid and gid /etc/passwd displays
for mqm, for example, mqm:x:501:100:MQ User:/var/mqm:/bin/bash |
Match the uid and gid for mqm in /etc/passwd and reboot if you have had to change the values. |
Create log and data directories in
a common folder, /MQHA, that is to be shared.
For example,
|
Create the folder, /MQHA,
to mount the shared file system. Keep the path the same as on server
1; for example:
|
Ensure that the MQHA directories
are owned by user and group mqm, and the access permissions are set
to rwx for user and group; for example ls -al displays, drwxrwxr–x mqm mqm 4096 Nov 27 14:38 MQDATA
|
|
Create the queue manager: crtmqm -ld /MQHA/logs -md /MQHA/qmgrs -q QM1 |
|
Add1 /MQHA *(rw,sync,no_wdelay,fsid=0) to /etc/exports | |
Start the NFS daemon: /etc/init.d/nfs start | |
Discover the host name or IP address of server 1: ifconfig2 | Mount the exported file system /MQHA: mount -hard -intr -t nfs4 192.168.217.130:/ /MQHA |
Copy the queue manager configuration details
from Server 1,
and
copy the result to the clip board,
|
Paste the queue manager configuration command
into Server 2,
|
Start the queue manager instances, in either order, with the -x parameter: strmqm -x QM1 |