You must create, configure, and start three queue managers to create the Native HA
group.
About this task
The recommended method for creating a Native HA solution is by using the IBM® MQ operator (see Native HA). Alternatively, if you create your own containers, you can follow these instructions.
To create a Native HA group, you create three queue managers on three nodes with their log type
set to log replication. You then edit the qm.ini file for each
queue manager to add the connection details for each of the three nodes so that they can replicate
log data to each other.
You must then start all three queue managers so that they can check that all three instances can
communicate with one another, and determine which of them will be the active instance and which will
be the replicas.
Procedure
-
On each of the three nodes, create a queue manager, specifying a log type of log replica, and
supplying a unique name for each log instance. Each queue manager has the same name:
crtmqm -lr instance_name qmname
For
example:
node 1> crtmqm -lr qm1_inst1 qm1
node 2> crtmqm -lr qm1_inst2 qm1
node 3> crtmqm -lr qm1_inst3 qm1
-
On successful creation of each queue manager, an additional stanza named
NativeHALocalInstance is added to the queue manager configuration file,
qm.ini. A Name attribute is added to the stanza specifying the
supplied instance name.
You can add optionally add the following attributes to the NativeHALocalInstance
stanza in the qm.ini file:
KeyRepository
- The location of the key repository that holds the digital certificate to use for protection of
log replication traffic. The location is given in stem format, that is, it includes the full path
and file name without an extension. If the
KeyRepository stanza attribute is
omitted, log replication data is exchanged between instances in plain text.
CertificateLabel
- The certificate label identifying the digital certificate to use for protection of log
replication traffic. If
KeyRepository is provided but
CertificateLabel is omitted, a default value of
ibmwebspheremqqueue_manager is used.
CipherSpec
- The MQ CipherSpec to use to protect log replication traffic. If this stanza attribute is
provided,
KeyRepository must also be provided. If KeyRepository is
provided but CipherSpec is omitted, a default value of ANY is
used.
LocalAddress
- The local network interface address that accepts log replication traffic. If this stanza
attribute is provided it identifies the local network interface and/or port using the format
“[addr][(port)]”. The network address can be specified as a hostname, IPv4 dotted decimal, or IPv6
hexadecimal format. If this attribute is omitted, the queue manager attempts to bind to all network
interfaces, it uses the port specified in the
ReplicationAddress in the
NativeHAInstances stanza matching the local instance name.
HeartbeatInterval
- The heartbeat interval defines how often in milliseconds an active instance of a Native HA queue
manager sends a network heartbeat. The valid range of the heartbeat interval value is 500 (0.5
seconds) to 60000 (1 minute), a value outside of this range causes the queue manager to fail to
start. If this attribute is omitted, a default value of 5000 (5 seconds) is used. Each instance must
use the same heartbeat interval.
HeartbeatTimeout
- The heartbeat timeout defines how long a replica instance of a Native HA queue manager waits
before it decides that the active instance is unresponsive. The valid range of the heartbeat
interval timeout value is 500 (0.5 seconds) to 120000 (2 minutes). The value of the heartbeat
timeout must be greater than or equal to the heartbeat interval.
An invalid value causes the queue
manager to fail to start. If this attribute is omitted a replica waits for 2 x
HeartbeatInterval before starting the process to elect a new active instance. Each
instance must use the same heartbeat timeout.
RetryInterval
- The retry interval defines how often in milliseconds a Native HA queue manager should retry a
failed replication link. The valid range of the retry interval is 500 (0.5 seconds) to 120000 (2
minutes). If this attribute is omitted a replica waits for 2 x
HeartbeatInterval
before retrying a failed replication link.
-
Edit the qm.ini file for each queue manager and add connection details.
You add three
NativeHAInstance stanzas, one for each queue manager instance in the
Native HA group (including the local instance). Add the following attributes:
- Name
- Specify the instance name that you used when you created the queue manager instance.
- ReplicationAddress
- Specify the hostname, IPv4 dotted decimal or IPv6 hexadecimal format address of the instance.
You can specify the address as a hostname, IPv4 dotted decimal, or IPv6 hexadecimal format address.
The replication address must be resolvable and routable from each instance in the group. The port
number to use for the log replication must be specified in brackets, for
example:
ReplicationAddress=host1.example.com(4444)
Note: The NativeHAInstance stanzas are identical on every instance and could be
provided by using automatic configuration (crtmqm -ii).
-
Start each of the three instances:
strmqm QMgrName
When the instances are started they
communicate to check that all three instances are running, then decide which of the three is the
active instance, while the other two instances continue to run as replicas.
Example
The following example shows the section of a qm.ini file specifying
the required Native HA details for one of the three
instances:NativeHALocalInstance:
LocalName=node-1
NativeHAInstance:
Name=node-1
ReplicationAddress=host1.example.com(4444)
NativeHAInstance:
Name=node-2
ReplicationAddress=host2.example.com(4444)
NativeHAInstance:
Name=node-3
ReplicationAddress=host3.example.com(4444)