Sun Java System Message Queue 4.1 Administration Guide

Preventing or Forcing Takeover of a Broker

Although the takeover of a failed broker’s persistent data by another broker in an HA cluster is normally automatic, there may be times when you want to prevent such a takeover from occurring. To suppress automatic takeover when shutting down a broker, use the -nofailover option to the imqcmd shutdown bkr subcommand:

   imqcmd shutdown bkr  -nofailover  -b hostName:portNumber

where hostName and portNumber are the host name and port number of the broker to be shut down.

Conversely, you may sometimes need to force a broker takeover to occur manually. (This might be necessary, for instance, if an automatic takeover broker were to fail before completing the takeover process.) In such cases, you can initiate a takeover manually from the command line: first shut down the broker to be taken over with the -nofailover option, as shown above, then issue the command

   imqcmd takeover bkr  -n brokerID

where brokerID is the broker identifier of the broker to be taken over. If the specified broker appears to be running, the Command utility will display a confirmation message:

   The broker associated with brokerID last accessed the database # seconds ago. 
   Do you want to take over for this broker?

You can suppress this message, and force the takeover to occur unconditionally, by using the -f option to the imqcmd takeover bkr command:

   imqcmd takeover bkr  -f  -n brokerID

Note –

The imqcmd takeover bkr subcommand is intended only for use in failed-takeover situations. You should use it only as a last resort, and not as a general way of forcibly taking over a running broker.


You may also find it useful to quiesce a broker before shutting it down, causing it to refuse any new client connections while continuing to service old ones. This allows the broker’s operations to wind down gradually without triggering a takeover by another broker, for instance in preparation for shutting it down administratively for upgrade or similar purposes; see Quiescing a Broker for more information.