Automatic configuration of qm.ini at startup
From IBM® MQ 9.2.0, you can configure your queue manager to automatically apply the contents of a file, or set of files, containing qm.ini overrides, on every queue manager start.
You can use this to have a configuration that can be modified and automatically replayed at the next queue manager restart. For example, if the qm.ini overrides are located on a mounted drive, it is possible to have a centralized configuration where the latest version is applied to every queue manager as they start.
Before you begin
- A single file, and create a text file containing changes to the qm.ini file.
- A set of qm.ini format files:
- To identify a directory where the configurations will exist, and
- In that directory, create files, each with the extension .ini, for example, qminisettings.ini.
Channels:
MaxChannels=1234
Note that in qm.ini override files, any line that is prefixed with
#
is treated as a comment.
Enabling automatic configuration of qm.ini file attributes
You can configure a new queue manager by using the -ii flag to the crtmqm command, and pointing either at a specific file, or directory. The supplied value is stored in the qm.ini file under the AutoConfig stanza, as attribute IniConfig.
AutoConfig:
IniConfig=C:\MQ_Configuration\uniclus.ini
How does automatic configuration work?
During queue manager startup, the configuration that is identified by the AutoConfig stanza attribute IniConfig is validated, to ensure valid syntax, and then stored in the queue manager data tree into the autocfg directory as a single cached.ini file.
When multiple files from a directory are processed in, they are processed in alphabetical order.
During the first ever start of the queue manager, an inability to read the file or directory prevents the queue manager from starting, with an appropriate error message both to the console and to the queue manager error log.
On subsequent restarts, if the file or directory pointed to is unreadable, the previously cached file is used and a message written to the error log of the queue manager highlights this.
When you use the strmqm command, the contents of the cached.ini file are applied to the qm.ini file as overrides before the queue manager is invoked.
This does mean that for a standby queue manager, the settings are read when the strmqm command is processed, not when the queue manager becomes active.
How does the replacement qm.ini file get built?
The very first time that automatic initialization configuration is configured and the queue manager starts, a copy of the current qm.ini file is copied into the autoconfig subdirectory inside the data directory of the queue manager as base_qm.ini. This is considered the baseline from here onwards.
On every queue manager start, that is, strmqm time, the currently active qm.ini file is discarded and replaced with a copy of the base_qm.ini. Then the configuration from the cached.ini file is applied to this file.
Once a queue manager is under automatic configuration control, all changes to the qm.ini file should be performed through the file, or files, that are pointed to using the IniConfig attribute in the AutoConfig stanza.
Because the existing qm.ini file is removed at queue manager start, only the configuration in the supplied qm.ini file using the IniConfig attribute is applied to the queue manager base line.
If a stanza or attribute was changed through automatic initialization configuration on previous starts of the queue manager, those changes are removed unless they are still identified in the file or files identified by the IniConfig attribute.
- Make the change to the base_qm.ini file itself.
- Delete the base_qm.ini file.
If you do delete this file, the base_qm.ini is re-created at the next queue manager start, based on the current contents of the qm.ini file. This hardens all the current changes as the new baseline for future starts.