crtmqm (create queue manager)
Use the crtmqm command to create a queue manager and define the default and system objects.
The objects created by the crtmqm command are listed in System and default objects. When you have created a queue manager, use the strmqm command to start it.
The queue manager is automatically associated with the installation from which the crtmqm command was issued. To change the associated installation, use the setmqm command.
Note that the Windows installer
does not automatically add the user that performs the installation to the mqm
group. For more details, see Authority to
administer IBM® MQ on AIX®, Linux®, and Windows systems.
![[Linux]](nglinux.gif)
Usage notes
You can use the environment
variable MQLICENSE to accept or view the license.
The options you can set the MQLICENSE environment variable to are 'accept' or 'view'. Other values are treated as if the environment variable is not set.
Syntax
Required parameters
- QMgrName
-
The name of the queue manager that you want to create. The name can contain up to 48 characters. This parameter must be the last item in the command.
Optional parameters
-a AccessGroup
or -ar AccessGroup-
Use the access group parameter to specify a Windows security group, members of which will be granted full access to all queue manager data files. The group can either be a local or global group, depending on the syntax used.
- -c Text
-
Descriptive text for this queue manager. You can use up to 64 characters; the default is all blanks.
- -d DefaultTransmissionQueue
-
The name of the local transmission queue where remote messages are put if a transmission queue is not explicitly defined for their destination. There is no default.
-fe -
Specifies that the file system for the queue manager is encrypted. You can optionally specify the encryption passphrase by using the -fp parameter, otherwise you are prompted for the passphrase when you run the command.
-fp Passphrase-
Used in conjunction with the -fe parameter, optionally specifies the encryption passphrase. If you specify -fe but omit -fp you are prompted for the passphrase when you run the command. The passphrase can be between 1 and 512 characters. You should store a copy of the passphrase somewhere safe.
![[AIX]](ngaix.gif)
-g ApplicationGroup-
On AIX and Linux, the name of the group that contains members that are allowed to perform the following actions:
- Run MQI applications
- Update all IPCC resources
- Change the contents of some queue manager directories
- -h MaximumHandleLimit
-
The maximum number of handles that an application can open at the same time.
-ic FilePath-
Automatic configuration of MQSC attributes.
-ii FilePath-
Automatic configuration of qm.ini file attributes.
-iv VARIABLE=VALUE[;VARIABLE=VALUE]-
Configuration variable for use with automatic uniform clusters.
If you specify the logging attributes in the mqs.ini file, those attributes override the default values of the logging command line parameters to crtmqm.
-lb BufferSize-
The journal buffer size. This is a number in the range 32000 - 15761440. The default is 32000.
- -lc
-
Use circular logging. This method is the default logging method.
- -ld LogPath
-
The directory used to store log files. The default directory to store log paths is defined when you install IBM MQ.
- -lf LogFilePages
-
The log data is held in a series of files called log files. The log file size is specified in units of 4 KB pages.
-ll LinearLogging-
Use linear logging.
-lla-
Use linear logging with automatic management of log extents (LogManagement=Automatic).
-lln-
Use linear logging with archive management of log extents (LogManagement=Archive).
![[IBM MQ Advanced]](ngadv.gif)
-lr InstanceName-
Use log replication. Specify this option when configuring a Native HA group. The InstanceName provided is used by Native HA to identify this copy of log data and must be unique. The InstanceName can contain up to 48 characters. Valid characters in an InstanceName are:
- Uppercase or lowercase alphabetics (A-Z, a-z)
- Numeric characters (0-9)
- Dash (-), the leading character is not permitted to be a dash
- Period (.)
- Underscore (_)
- -lp LogPrimaryFiles
-
The log files allocated when the queue manager is created.
- -ls LogSecondaryFiles
-
The log files allocated when the primary files are exhausted.
-lz ASPInfo
Specify an auxiliary storage pool number (1-32, default 1) or an auxiliary storage pool device name for the IBM i journal.
- -md DataPath
The directory used to hold the data files for a queue manager.
- -oa group|user|UserExternal
![[AIX]](ngaix.gif)
On AIX and Linux systems, you can specify whether group or user authorization is to be used. If you do not set this parameter, group authorization is used. You can change the authorization model later by setting the SecurityPolicy parameter in the Service stanza of the qm.ini file (see Service stanza of the qm.ini file).
- -p PortNumber
-
Create a managed TCP listener on the specified port.
Specify a valid port value in the range 1-65535, to create a TCP listener object that uses the specified port. The new listener is called SYSTEM.LISTENER.TCP.1. This listener is under queue manager control, and is started and stopped along with the queue manager.
- -q
-
Makes this queue manager the default queue manager. The new queue manager replaces any existing default queue manager.
![[MQ 9.4.4 Oct 2025]](ng944.gif)
-re - Secure all the replication links for an RDQM configuration with TLS. This option secures the HA replication connections for an HA configuration, the DR replication connection for a DR configuration, and both the HA and DR replication connections for an HA/DR configuration.
![[MQ 9.4.4 Oct 2025]](ng944.gif)
-red - Secure the DR replication link of an RDQM HA/DR configuration with TLS. The HA replication links are not secured.
![[MQ 9.4.4 Oct 2025]](ng944.gif)
-reh - Secure the HA replication links of an RDQM HA/DR configuration with TLS. The DR replication link is not secured.
-rr InstanceType-
Create a disaster recovery replicated data queue manager (DR RDQM). Specify -rr p to create the primary instance of the queue manager or specify -rr s to create the secondary instance. You must be
rootor a user in themqmgroup withsudoprivileges to use this command.
-rt ReplicationType-
Optionally specify whether your DR RDQM configuration uses synchronous or asynchronous replication. Specify -rt s for synchronous and -rt a for asynchronous. Asynchronous is the default.
-rl LocalIP-
Specify the local IP address used for replication of data between primary and secondary instances of a DR RDQM.
-ri RemoteIP-
Specify the remote IP address used for replication of data between primary and secondary instances of a DR RDQM.
-rn RemoteName-
Specifies the name of the system that is hosting the other instance of the queue manager. The name is the value that is returned if you run
uname -non that server.
-rp DRPortx-
Specifies the port to use for DR replication.
-sa-
Automatic queue manager startup, for the appliance. The queue manager is configured to start automatically when the appliance restarts. This argument is mutually exclusive with
-sx.
-sa-
Automatic queue manager startup. For Windows systems.
-sax-
Automatic queue manager startup, permitting multiple instances. For Windows systems only.
![[MQ 9.4.4 Oct 2025]](ng944.gif)
-san SubjectAltName-
Specifies the group DNS name that is used in the Subject Alternative Name (SAN) of the certificates that are used to secure the replication links in a RDQM DR/HA configuration.
- -si
-
Interactive (manual) queue manager startup.
- -ss
-
Service (manual) queue manager startup.
-sx [-fs FilesystemSize] [DR parameters]
[secure replication parameters]-
Create a high availability replicated data queue manager (HA RDQM) on the primary node for that queue manager (do not specify DR parameters). RDQM is a high availability solution that is available on Linux only. See Creating an HA RDQM for more details about creating an RDQM. You must be
rootor a user in themqmgroup withsudoprivileges to use this command. The default size for file system size is 3 GB. You can specify a different file system size using the-fsoption. The default unit is GB (so-fs 8creates an 8 GB file system size). You can specify a different unit, for example, specify-fs 1024Mto create a 1024 MB file system size. The queue manager is started automatically.
-sxs [DR parameters] [-fs FilesystemSize]
[secure replication parameters]-
Create a replicated data queue manager (RDQM) on a secondary node (do not specify DR parameters). RDQM is a high availability solution that is available on Linux only. See Creating an HA RDQM for more details about creating an RDQM. You must be the
rootuser to use this command. The default size for file system size is 3 GB. The default size for file system size is 3 GB. You can specify a different file system size using the-fsoption. The default unit is GB (so-fs 8creates an 8 GB file system size). You can specify a different unit, for example, specify-fs 1024Mto create a 1024 MB file system size. - -t IntervalValue
-
The trigger time interval in milliseconds for all queues controlled by this queue manager. This value specifies the length of time triggering is suspended, after the queue manager receives a trigger-generating message. That is, if the arrival of a message on a queue causes a trigger message to be put on the initiation queue, any message arriving on the same queue within the specified interval does not generate another trigger message.
- -u DeadLetterQueue
-
The name of the local queue that is to be used as the dead-letter (undelivered-message) queue. Messages are put on this queue if they cannot be routed to their correct destination.
- -x MaximumUncommittedMessages
-
The maximum number of uncommitted messages under any one sync point. The uncommitted messages are the sum of:
- The number of messages that can be retrieved from queues
- The number of messages that can be put on queues
- Any trigger messages generated within this unit of work
- -z
-
Suppresses error messages.
This flag is used within IBM MQ to suppress unwanted error messages. Do not use this flag when using a command line. Using this flag can result in a loss of information.
Return codes
| Return code | Description |
|---|---|
| 0 | Queue manager created |
| 8 | Queue manager exists |
| 18 | Invalid trigger interval |
| 19 | Invalid dead letter queue |
| 20 | Invalid default transmit queue |
| 21 | Invalid max handles value |
| 22 | Invalid max uncommitted messages value |
| 25 | Error creating the queue manager directory structure |
| 37 | Invalid queue manager description |
| 38 | The access group specified cannot be found |
| 39 | Invalid parameter specified |
| 49 | Queue manager stopping |
| 58 | Inconsistent use of installations detected |
| 63 | Invalid Native HA instance name |
| 69 | Storage unavailable |
| 70 | Queue space unavailable |
| 71 | Unexpected error |
| 72 | Queue manager name error |
| 74 | The IBM MQ service is not started |
![]() 93 |
Log replication is unavailable on this platform |
| 95 | Log replication is incompatible with RDQM |
| 100 | Log location invalid |
| 105 | The queue manager was created but could not be set as the default queue manager |
| 111 | Queue manager created. However, there was a problem processing the default queue manager definition in the product configuration file. The default queue manager specification might be incorrect |
| 115 | Invalid log size |
| 119 | Permission denied |
| 155 | The group ID specified is not valid |
| 156 | The owning group ID can only be changed on AIX and Linux systems |
| 157 | The group ID chosen is invalid |
Examples
- The following command creates a default queue manager called
Paint.queue.manager, with a description ofPaint shop, and creates the system and default objects. It also specifies that linear logging is to be used:crtmqm -c "Paint shop" -ll -q Paint.queue.manager - The following command creates a default queue manager called
Paint.queue.manager, creates the system and default objects, and requests two primary and three secondary log files:crtmqm -c "Paint shop" -ll -lp 2 -ls 3 -q Paint.queue.manager - The following command creates a queue manager called
travel, creates the system and default objects, sets the trigger interval to 5000 milliseconds (5 seconds), and specifiesSYSTEM.DEAD.LETTER.QUEUEas its dead-letter queue.crtmqm -t 5000 -u SYSTEM.DEAD.LETTER.QUEUE travel ![[AIX]](ngaix.gif)
The following command creates a queue manager called
QM1on AIX and Linux systems, which has log and queue manager data folders in a common parent directory. The parent directory is to be shared on highly available networked storage to create a multi-instance queue manager. Before issuing the command, create other parameters /MQHA, /MQHA/logs and /MQHA/qmgrs owned by the user and groupmqm, and with permissionsrwxrwxr-x.crtmqm -ld /MQHA/logs -md /MQHA/qmgrs QM1
