Managing queue manager locations in a high availability group

You can specify that queue managers have a preferred appliance in the high availability pair.

About this task

You can specify that a queue manager always runs on a particular appliance in the HA pair, if that appliance is available. By default, the preferred appliance for a queue manager is the appliance that the queue manager was created on. You can use the sethapreferred command to specify a preferred appliance in circumstances such as replacing a failed node, or specifying the favored appliance when an existing queue manager is added to an HA group. The sethapreferred is used in conjunction with the clearhapreferred command. You can also use these commands from the IBM® MQ Console.

In normal circumstances, when both appliances in the group are available and neither has been suspended, sethapreferred can be used to relocate a queue manager immediately from one appliance to another, by executing the command on the target appliance. This might be used to move a queue manager back to its natural home appliance in a controlled manner following an outage triggered automatic failover.

When you issue the sethapreferred command, the queue manager immediately ends on its current host appliance and starts on the appliance where the command is issued. To revert to manual control of preferred location (leaving the queue manager running on its new host), issue the clearhapreferred command.

If a failure occurs, and the queue manager fails over to the other appliance in the pair, it resumes running on its preferred appliance as soon as that appliance is available. If you have not specified a preferred appliance, in this situation the queue manager continues to run on the appliance it has failed over to unless you manually intervene. For possible causes of failover, see Causes of HA failover.

It is possible that conflicting sethapreferred and clearhapreferred commands might be issued when the appliances are disconnected. For example, both appliances might be set, or cleared, as the preferred location. When the appliances are reconnected, the conflict resolves to a consistent state, but that means that one of the commands on one of the appliances is silently undone. You should check which appliance is the preferred location when appliance reconnect after a fail over.

Procedure

  • To set the current appliance as the preferred appliance for a queue manager:
    1. Enter the IBM MQ administration mode by entering the following command:
      
      mqcli
      
    2. Specify that the current appliance is the preferred appliance for the named queue manager:
      
      sethapreferred QMName
      
  • To specify that the current appliance is no longer the preferred appliance for a queue manager:
    1. Enter the IBM MQ administration mode by entering the following command:
      
      mqcli
      
    2. Specify that the current appliance is no longer the preferred appliance for the named queue manager:
      
      clearhapreferred QMName
      
  • To set the current appliance as the preferred appliance for a queue manager by using the IBM MQ Console:
    1. In the Manage view, open the High availability tab.
    2. Locate the queue manager that you want to work with in the list and select Set preferred location from the menu Shows the menu icon.
    3. Select This appliance in the Preferred location window.
  • To specify that the current appliance is no longer the preferred appliance for a queue manager by using the New Web Console:
    1. In the Manage view, open the High availability tab.
    2. Locate the queue manager that you want to work with in the list and select Set preferred location from the menu Shows the menu icon.
    3. Select No preference in the Preferred location window.