[Linux]

Create a multi-instance queue manager on Linux

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.

About this task

The example is set up on a 2 GHz notebook computer with 3 GB RAM running Windows 7 Service Pack 1. Two VMware virtual machines, Server1 and Server2, run Linux Red Hat Enterprise 5 in 640 MB images. Server1 hosts the network file system (NFS), the queue manager logs and an HA instance. It is not usual practice for the NFS server also to host one of the queue manager instances; this is to simplify the example. Server2 mounts Server1's queue manager logs with a standby instance. A WebSphere® MQ MQI client is installed on an additional 400 MB VMware image that runs Windows 7 Service Pack 1 and runs the sample high availability applications. All the virtual machines are configured as part of a VMware host-only network for security reasons.

Note: You should put only queue manager data on an NFS server. On the NFS, use the following three options with the mount command to make the system secure:
  • noexec
    By using this option, you stop binary files from being run on the NFS, which prevents a remote user from running unwanted code on the system.
  • nosuid
    By using this option, you prevent the use of the set-user-identifier and set-group-identifier bits, which prevents a remote user from gaining higher privileges.
  • nodev
    By using this option, you stop character and block special devices from being used or defined, which prevents a remote user from getting out of a chroot jail.

Procedure

  1. Log in as root.
  2. Read Installing IBM® MQ - overview and follow the appropriate link to install IBM MQ, create the mqm user and group, and define /var/mqm.
  3. Complete the task Verifying shared file system behavior to check that the file system supports multi-instance queue managers.
  4. For Server1, complete the following step:
    1. Create log and data directories in a common folder, /MQHA, that is to be shared. For example:
      1. mkdir /MQHA
      2. mkdir /MQHA/logs
      3. mkdir /MQHA/qmgrs
  5. For Server2, complete the following step:
    1. Create the folder, /MQHA, to mount the shared file system. Keep the path the same as on Server1. For example:
      1. mkdir /MQHA
  6. 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 .
    1. chown -R mqm:mqm /MQHA
    2. chmod -R ug+rwx /MQHA
  7. Create the queue manager by entering the following command: crtmqm -ld /MQHA/logs -md /MQHA/qmgrs QM1
  8. Add 1 /MQHA *(rw,sync,no_wdelay,fsid=0) to /etc/exports
  9. For Server1, complete the following steps:
    1. Start the NFS daemon: /etc/init.d/ nfs start
    2. Copy the queue manager configuration details from Server1:
      
       dspmqinf -o command QM1
      
      and copy the result to the clipboard:
      
      addmqinf -s QueueManager
      -v Name=QM1
      -v Directory=QM1
      -v Prefix=/var/mqm
      -v DataPath=/MQHA/qmgrs/QM1
      
  10. For Server2, complete the following steps:
    1. Mount the exported file system /MQHA by entering the following command: mount -t nfs4 -o hard,intr Server1:/ /MQHA
    2. Paste the queue manager configuration command into Server2:
      
       addmqinf -s QueueManager
      -v Name=QM1
      -v Directory=QM1
      -v Prefix=/var/mqm
      -v DataPath=/MQHA/qmgrs/QM1
      
  11. Start the queue manager instances, in either order, with the -x parameter: strmqm -x QM1.

    The command used to start the queue manager instances must be issued from the same IBM MQ installation as the addmqinf command. To start and stop the queue manager from a different installation, you must first set the installation associated with the queue manager using the setmqm command. For more information, see setmqm.

1 The '*' allows all machines that can reach this one mount /MQHA for read/write. Restrict access on a production machine.