[MQ 9.4.4 Oct 2025]

Creating a Native HA queue manager

You need three nodes to create a Native HA queue manager with three instances on Linux. The nodes can be docker containers, virtual machines, or bare-metal servers, although you must use the same type of node for all three instances.

About this task

Each node must initially be able to communicate with the other nodes and start with the same IBM® MQ maintenance level.

You create the three Native HA instances by using the crtmqm command on each node (although the three instances constitute a single queue manager).

In this example, the nodes have the host names alpha, beta, and gamma. For simplicity, these names are also used as the instance names inside the group. The group name is datacenter1.

The queue manager is called MYQMGR, and is created with ten primary and ten secondary extents of 32 MB. The -p option is specified to tell the queue manager to start a TCP/IP listener for channels and clients on port 1414, and start this when an instance is elected to start as an active.

After you create the three instances, you edit the qm.ini file for each instance to add information that lets them communicate with one another.

Procedure

  1. Create the first instance on the node named alpha:
    crtmqm -lr alpha -lf 8192 -lp 10 -ls 10 -p 1414 MYQMGR
    The queue manager is created:
    IBM MQ queue manager 'MYQMGR' created.
    Directory '/var/mqm/qmgrs/MYQMGR' created.
    The queue manager is associated with installation 'Installation1'.
    Creating or replacing default objects for queue manager 'MYQMGR'.
    Default objects statistics : 83 created. 0 replaced. 0 failed.
    Completing setup.
    Setup completed.
    
  2. Create the second instance on the node named beta:
    crtmqm -lr beta -lf 8192 -lp 10 -ls 10 -p 1414 MYQMGR
  3. Create the third instance on the node named gamma:
    crtmqm -lr gamma -lf 8192 -lp 10 -ls 10 -p 1414 MYQMGR
  4. Add information to the qm.ini file for each instance:
    
    NativeHAInstance:
      Name=alpha
      ReplicationAddress=alpha.example.com(9414)
    NativeHAInstance:
      Name=beta
      ReplicationAddress=beta.example.com(9414)
    NativeHAInstance:
      Name=gamma
      ReplicationAddress=gamma.example.com(9414)
    
  5. You can now start the queue manager on each node:
    strmqm MYQMGR

Results

After the instances have started, the first election takes place to choose the first leader and permanently set the QMId. This first election is special in that it requires all three instances to participate, whereas subsequent elections only require a majority to participate. The leader’s log is replicated in plaintext over the network links to the two other replicas. When one of the two replicas is synchronized with the leader, there is quorum to begin writing to the log.

When the elected leader has quorum, it performs normal queue manager startup and becomes the active queue manager instance and opens for application connections. You can now connect applications and start using commands such as runmqsc to define and alter the settings of the queue manager.