이 콘텐츠는 선택한 언어로 제공되지 않습니다.

11.2. Shutting Down a Broker Remotely


Abstract

You have a number of options for stopping a broker running on a remote machine. You can stop the broker using a console or without using a console. You can also step a broker remotely using the management console.

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. Red Hat AMQ 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 the management console—brokers that are part of a fabric can be stopped using a management console connected to their fabric
    For more information see Using the Management Console.

Using the stop command

You can stop a remote instance without starting up Red Hat AMQ on your local host by running the stop command in the InstallDir/bin directory. The commands syntax is shown in Example 11.2, “Stop Command Syntax”.

Example 11.2. 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.
Note
The default username for a broker is karaf.
-p password
Specifies the password used to connect to the remote broker.
Note
The default password for a broker is karaf.
Example 11.3, “Stopping a Remote Broker” shows how to stop a remote broker on a machine named NEBrokerHost2.

Example 11.3. Stopping a Remote Broker

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

Using a remote console

Red Hat AMQ's console can be connected to a remote broker using the ssh:ssh command. The SSH port 8101 is used to access the desired remote console. Once the console is connected to the remote broker, you can shut it down by running the osgi:shutdown command. Example 11.4, “Shutting Down a Broker using a Remote Console Connection” shows the command sequence for using a remote console connection to shutdown a broker running on a machine named NWBrokerHost.

Example 11.4. Shutting Down a Broker using a Remote Console Connection

JBossA-MQ:karaf@root> ssh -l username -P password 8101 HOSTNAME
       _ ____ __ __ ____ | | _ \ /\ | \/ |/ __ \ | | |_) | ___ ___ ___ / \ ______| \ / | | | | _ | | _ < / _ \/ __/ __| / /\ \______| |\/| | | | | | |__| | |_) | (_) \__ \__ \ / ____ \ | | | | |__| | \____/|____/ \___/|___/___/ /_/ \_\ |_| |_|\___\_\ AMQ (6.0.0.redhat-012) http://www.redhat.com/products/jbossenterprisemiddleware/amq/ 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 AMQ. 

JBossA-MQ:karaf@root> osgi:shutdown 
Confirm: shutdown instance root (yes/no):
yes
JBossA-MQ:karaf@root> JBossA-MQ:karaf@root>
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 11.5, “Shutting Down a Broker in a Fabric” shows how to use the administration client to shutdown a broker running in a container named fabric-broker3.

Example 11.5. Shutting Down a Broker in a Fabric

./bin/client fabric-broker3 fabric:container-stop
Red Hat logoGithubRedditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

© 2024 Red Hat, Inc.