[UNIX][Linux]

Example directory configurations on UNIX and Linux systems

Examples of alternative file system configurations on UNIX and Linux® systems.

You can customize the IBM® MQ directory structure in various ways to achieve a number of different objectives.

  • Place the qmgrs and log directories on remote shared file systems to configure a multi-instance queue manager.
  • Use separate file systems for the data and log directories, and allocate the directories to different disks, to improve performance by reducing I/O contention.
  • Use faster storage devices for directories that have a greater effect on performance. Physical device latency is frequently a more important factor in the performance of persistent messaging than whether a device is mounted locally or remotely. The following list shows which directories are most and least performance sensitive.
    1. log
    2. qmgrs
    3. Other directories, including /usr/mqm
  • Create the qmgrs and log directories on file systems that are allocated to storage with good resilience, such as a redundant disk array, for example.
  • It is better to store the common error logs in var/mqm/errors, locally, rather than on a network file system, so that error relating to the network file system can be logged.
Figure 1 is a template from which alternative IBM MQ directory structures are derived. In the template, dotted lines represent paths that are configurable. In the examples, the dotted lines are replaced by solid lines that correspond to the configuration information stored in the AMQ_MQS_INI_LOCATION environment variable, and in the mqs.ini and qm.ini files.
Note: The path information is shown as it appears in the mqs.ini or qm.ini files. If you supply path parameters in the crtmqm command, omit the name of the queue manager directory: the queue manager name is added to the path by IBM MQ.
Figure 1. Directory structure pattern template
IBM MQ directories are shown as children of /var/mqm. The children are qmgrs, log and a catchall to represent other directories that are children of /var/mqm, such as errors and trace. Qmgrs and log both have a queue manager child for every queue manager that is created. Each of these queue manager children, and the errors directory, have more children that are not shown in detail on the diagram. Dotted lines are used to identify configurable paths.

Typical directory structure for IBM MQ

Figure 2 is the default directory structure created in IBM MQ by issuing the command crtmqm QM1.

The mqs.ini file has a stanza for the QM1 queue manager, created by referring to the value of DefaultPrefix. The Log stanza in the qm.ini file has a value for LogPath, set by reference to LogDefaultPath in mqs.ini.

Use the optional crtmqm parameters to override the default values of DataPath and LogPath.

Figure 2. Example default IBM MQ directory structure for UNIX and Linux systems
IBM MQ directories are shown as children of /var/mqm.

Share default qmgrs and log directories

An alternative to Share everything, is to share the qmgrs and log directories separately ( Figure 3 ). In this configuration, there is no need to set AMQ_MQS_INI_LOCATION as the default mqs.ini is stored in the local /var/mqm file system. The files and directories, such as mqclient.ini and mqserver.ini are also not shared.
Figure 3. Share qmgrs and log directories
A simple configuration in which the qmgrs and log directories are mounted as shared file systems in their default location.

Share named qmgrs and log directories

The configuration in Figure 4 places the log and qmgrs in a common named remote shared file system called /ha. The same physical configuration can be created in two different ways.
  1. Set LogDefaultPath=/ha and then run the command, crtmqm - md /ha/qmgrs QM1. The result is exactly as illustrated in Figure 4.
  2. Leave the default paths unchanged and then run the command, crtmqm - ld /ha/log - md /ha/qmgrs QM1.
Figure 4. Share named qmgrs and log directories
In this example, the qmgrs and log directories are children of a named share (ha in the picture). The /ha share is mounted as a shared file system.

Share everything

Figure 5 is a simple configuration for system with fast networked file storage.

Mount /var/mqm as a remote shared file system. By default, when you start QM1, it looks for /var/mqm, finds it on the shared file system, and reads the mqs.ini file in /var/mqm. Rather than use the single /var/mqm/mqs.ini file for queue managers on all your servers, you can set the AMQ_MQS_INI_LOCATION environment variable on each server to point to different mqs.ini files.
Note: The contents of the generic error file in /var/mqm/errors/ are shared between queue managers on different servers.
Figure 5. Share everything
Same as the previous figure, but in this example /var/mqm is mounted on a remote file system.

Note that you cannot use this for multi-instance queue managers. The reason is that it is necessary for each host in a multi-instance queue manager to have its own local copy of /var/mqm to keep track of local data, such as semaphores and shared memory. These entities cannot be shared across hosts.