LibraryToggle FramesPrintFeedback

Shutting Down a Broker Remotely

Overview

For many use cases logging into the machine running a broker instance is impractical. In those cases, you need a way to stop a broker from a remote machine. Fuse MQ Enterprise offers a number of ways to accomplish this task:

  • using the stop command—the stop command does not require starting an instance of the broker

  • using a remote console connection—a broker's console can be used to remotely shutdown a broker on another machine

  • using a fabric member's console—brokers that are part of a fabric can stop members of their fabric

  • using Fuse Management Console—brokers that are part of a fabric can be stopped using an Fuse Management Console connected to their fabric

    For more information see the Fuse Management Console Documentation.

Using the stop command

You can stop a remote instance without starting up Fuse ESB Enterprise on your local host by running the stop command in the InstallDir/bin directory. The commands syntax is shown in Example 42.

Example 42. Stop Command Syntax

stop [-a port] {-h hostname} {-u username} {-p password}


-a port

Specifies the SSH port of the remote instance. The default is 8101.

-h hostname

Specifies the hostname of the machine on which the remote instance is running.

-u username

Specifies the username used to connect to the remote broker.

[Tip]Tip

The default username for a broker is karaf.

-p password

Specifies the password used to connect to the remote broker.

[Tip]Tip

The default password for a broker is karaf.

Example 43 shows how to stop a remote broker on a machine named NEBrokerHost2.

Example 43. Stopping a Remote Broker

bin/stop -u karaf -p karaf -h NEBrokerHost2

Using a remote console

Fuse MQ Enterprise's console can be connected to a remote broker using the ssh:ssh command. Once the console is connected to the remote broker, you can shut it down by running the osgi:shutdown command. Example 44 shows the command sequence for using a remote console connection to shutdown a broker running on a machine named NWBrokerHost.

Example 44. Shutting DOwn a Broker using a Remote Console Connection

FuseMQ:karaf@root> ssh  -l karaf -P karaf NWBrokerHost
|  ___|                 |  \/  ||  _  |
| |_  _   _  ___   ___  | .  . || | | |
|  _|| | | |/ __| / _ \ | |\/| || | | |
| |  | |_| |\__ \|  __/ | |  | |\ \/' /
\_|   \__,_||___/ \___| \_|  |_/ \_/\_\
  Fuse MQ (7.0.0.fuse-beta-040)
  http://fusesource.org/mq/

Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Fuse MQ.

FuseMQ:karaf@root> osgi:shutdown 
Confirm: shutdown instance root (yes/no):
yes
FuseMQ:karaf@root> FuseESB:karaf@root>

[Important]Important

Pressing Control+D when connected to a remote broker closes the remote connection and returns you to the local shell.

Shutting down remote brokers in a fabric

If the broker you want to shutdown is part of a fabric, you can shut it down from any of the brokers in the fabric using the fabric:container-stop console command. fabric:container-stop takes the name of the fabric container hosting the broker as an argument. The command can be run either from a broker in console mode or using the broker's administration client.

Example 45 shows how to use the administration client to shutdown a broker running in a container named fabric-broker3.

Example 45. Shutting Down a Broker in a Fabric

./bin/client fabric-broker3 fabric:container-stop

For more information see fabric:container-stop, in Console Reference.

Comments powered by Disqus