Specifying a floating IP address for a queue manager

You can optionally specify a floating IP address for a high availability (HA) queue manager such that an application can connect whichever appliance the queue manager is running on.

Before you begin

Both appliances in the HA pair must be active when you specify a floating IP address for an HA queue manager.

About this task

If you specify a floating IP address for a queue manager, an application can use that address to connect to a queue manager regardless of which appliance in the HA pair the queue manager is actually running on.

This topic explains how to specify a floating IP address by using the command line. Using the IBM® MQ Console, you can specify a floating IP address when you create an HA queue manager (see IBM MQ Console: Creating a high availability queue manager and IBM MQ Console: Adding a queue manager to the high availability configuration). You can add a floating IP address to an existing HA queue mnager when you edit it in the IBM MQ Console.

You can define only one floating IP address for IBM MQ traffic on a queue manager, so you can only run the sethaint command once for each queue manager.

When you specify the floating IP address for IBM MQ traffic, you also specify the local interface that it can be reached on (for example, eth22). This interface must be a physical interface that exists on both appliances, and each interface must have a static IP address configured. You can also specify an aggregate interface that exists with the same name on each appliance. The name of the aggregate interface must obey certain rules to be used for this purpose, see link-aggregation.

The floating IP address must be a valid IPv4 address that is not already defined on either appliance, and it must belong to the same subnet as the static IP addresses defined for the local interface.

Note: If you make any changes to the configuration of the physical interface that is connected to the floating IP, then the HA queue manager that uses that floating IP will stop and cannot be restarted. This also applies if you change any aggregated interfaces. You must undo the changes to the interface before you can restart the HA queue manager by using the strmqm command. Alternatively, you can delete the queue manager when in this situation.

Procedure

  1. Enter the IBM MQ administration mode by entering the following command:

    mqcli

  2. Enter the following command to add the floating IP address to the queue manager:
    sethaint -m queue_manager_name -a -f floating_IP -l local_interface
    Where:
    queue_manager_name
    Is the queue manager that the floating IP address applies to.
    floating_IP
    Is the floating IP address in IPv4 format.
    local_interface
    Specifies the name of the local interface that is used to connect to the queue manager on the two appliances in the HA group. For example, eth22. You can also specify an aggregate interface name, provided that the name obeys certain naming rules (see link-aggregation).
  3. Optional: Exit the IBM MQ administration mode by entering the following command:

    exit

Example

The following example shows the floating IP address 192.0.2.15 being allocated for queue manager QM1 and associated with the local interface eth22:
sethaint -m QM1 -a -f 192.0.2.15 - l eth22

What to do next

After you have defined a floating IP address for a queue manager, you can bind that address to a listener or a channel.
For example, the following MQSC command binds a listener named listy to the floating IP address 192.0.2.15:
DEFINE LISTENER(listy) IPADDR(192.0.2.15)
The following MQSC command binds a sender channel named sendy to the floating IP address 192.0.2.15:
DEFINE CHANNEL(sendy) CHLTYPE(SDR) LOCLADDR(192.0.2.15)
If a queue manager with a floating IP address has to create a channel automatically, and that channel has to use the floating IP address for outbound communication, you must set the MQ_LCLADDR environment variable to the floating IP address. For example, the queue manager might create a CLUSSDR channel from a CLUSRCVR channel definition received from another queue manager. The following MQCLI command sets the MQ_LCLADDR to the floating IP address 192.0.2.15:
setmqvar -m QMgrName -k MQ_LCLADDR -v 192.0.2.15

You can use the local-address parameter of the test tcp-connection command to test your floating IP address, see test tcp-connection.