CLI Command Line Interface

Connect to SwiftMQ HA Router

CLI connects to the ACTIVE HA instance. The STANDBY HA instance is hidden. CLI automatically reconnects after failover and has always a connection to the ACTIVE HA instance.

Requests during Failover

CLI interacts with the Management Swiftlet of the ACTIVE HA instance in a request/reply manner. If a request (e.g. configuration change or viewing queue messages) is issued and a failover occurs before a reply to this request is received, the request will be canceled with a warning message. The request must be issued again after the failover.

CLI Admin API

There is a new CLIReconnectedException (extends CLIException) that can be used to recreate a CLI context after a failover. See the CLI Admin API documentation for detailed information and code samples.

Additional Commands

To manage both HA instances, CLI in HA edition has additional commands resp commands have changed behavior. These commands are located at the level of the router's Swiftlet Manager.

Commands with different behavior are:

Command

Description

reboot

Reboot ACTIVE and STANDBY HA instance

halt

Halt ACTIVE and STANDBY HA instance

save

Save ACTIVE and STANDBY configuration

New commands are:

Command

Description

rebootactive

Reboot ACTIVE HA instance

rebootstandby

Reboot STANDBY HA instance

haltactive

Halt ACTIVE HA instance

haltstandby

Halt STANDBY HA instance

Administration

Configuration Changes

Configuration changes are automatically replicated to the STANDBY HA instance. It doesn't matter if the STANDBY HA instance is not connected (state STANDALONE). Once it connects, the ACTIVE HA instance replicates the whole configuration to the STANDBY, so both HA instances are always in sync and consistent and configuration changes can be done at any time, no matter if the STANDBY is connected or not.

There are some configuration entities that are bound to the resp. HA instance (e.g. trace settings). These entities are not replicated. The High Availability Controller Swiftlet controls configuration replication. Under Configuration Controller / Replication Excludes is a list of configuration contexts (SQL LIKE predicates) that defines the elements that are excluded from replication. Never change this list! Example:

Additional Commands

SwiftMQ Explorer in HA edition has additional commands to manage both HA instances. These commands are located at the router node. See below (self-explanatory):

Router Configuration File

SwiftMQ HA Router consists of 2 HA instances. Each HA instance has a configuration file. It is recommended to apply changes via SwiftMQ Explorer or CLI. If you want to change directly in the configuration file, you must apply changes at both HA instances (hence, both instances must be stopped). If you apply changes at the STANDBY HA instance only, it has no effect (except for instance-specific changes, see below), because the STANDBY overwrites its copy with the configuration from the ACTIVE instance during connect.

Release 9.4.2 introduces a watchdog that detects and applies changes directly from the routerconfig.xml to a running HA instance. Note that general changes such as new queues etc must be applied to the ACTIVE resp. STANDALONE HA instance. Instance-specific configurations such as logging and tracing can also be applied to the STANDBY HA instance.

The configuration files are stored below the directory "config" of the HA instance.

Instance specific Configuration

Some parts of the configuration file are instance-specific. These are:

  • Deploy Swiftlet (sys$deploy)

  • Parts of the HA Controller Swiftlet (sys$hacontroller), see HA Controller Swiftlet documentation

  • Log Swiftlet (sys$log)

  • Store Swiftlet (sys$store)

  • Trace Swiftlet (sys$trace)

These parts will not be overwritten. For example, if you want to change the JDBC connection pool setting at the STANDBY HA instance, shut it down, apply the change in the routerconfig.xml and restart it. The STANDBY will use the changed configuration when it becomes the ACTIVE HA instance (after a failover).

HA Router specific Configuration

There are some entries at the top of the configuration file to configure the transition from one HA state to another:

<ha-router>
    <state-transition last="UNKNOWN" current="STANDALONE" operation="start" ..."/>
    <state-transition last="UNKNOWN" current="ACTIVE_SYNC_PREPARE" operation="start" ..."/>
    <state-transition last="UNKNOWN" current="STANDBY_SYNC_PREPARE" operation="standby" ..."/>
    <state-transition last="STANDBY%" current="STANDALONE" operation="resume" ..."/>
</ha-router>
XML

These parts are static. Never change it!