3.3. Starting broker instances


A broker instance is a directory containing all the configuration and runtime data, such as logs and data files. The runtime data is associated with a unique broker process.

You can start a broker in the foreground by using the artemis script, as a Linux service, or as a Windows service.

3.3.1. Starting the broker instance

After the broker instance is created, you use the artemis run command to start it.

Procedure

  1. Switch to the user account you created during installation.

    $ su - amq-broker
  2. Use the artemis run command to start the broker instance.

    $ /var/opt/amq-broker/mybroker/bin/artemis run
    
              __  __  ____    ____            _
        /\   |  \/  |/ __ \  |  _ \          | |
       /  \  | \  / | |  | | | |_) |_ __ ___ | | _____ _ __
      / /\ \ | |\/| | |  | | |  _ <| '__/ _ \| |/ / _ \ '__|
     / ____ \| |  | | |__| | | |_) | | | (_) |   <  __/ |
    /_/    \_\_|  |_|\___\_\ |____/|_|  \___/|_|\_\___|_|
    
    Red Hat JBoss AMQ 7.2.1.GA
    
    10:53:43,959 INFO  [org.apache.activemq.artemis.integration.bootstrap] AMQ101000: Starting ActiveMQ Artemis Server
    10:53:44,076 INFO  [org.apache.activemq.artemis.core.server] AMQ221000: live Message Broker is starting with configuration Broker Configuration (clustered=false,journalDirectory=./data/journal,bindingsDirectory=./data/bindings,largeMessagesDirectory=./data/large-messages,pagingDirectory=./data/paging)
    10:53:44,099 INFO  [org.apache.activemq.artemis.core.server] AMQ221012: Using AIO Journal
    ...

    The broker starts and displays log output with the following information:

    • The location of the transaction logs and cluster configuration.
    • The type of journal being used for message persistence (AIO in this case).
    • The URI(s) that can accept client connections.

      By default, port 61616 can accept connections from any of the supported protocols (CORE, MQTT, AMQP, STOMP, HORNETQ, and OPENWIRE). There are separate, individual ports for each protocol as well.

    • The web console is available at http://localhost:8161.
    • The Jolokia service (JMX over REST) is available at http://localhost:8161/jolokia.

3.3.2. Starting a broker as a Linux service

If the broker is installed on Linux, you can run it as a service.

Procedure

  1. Create a new amq-broker.service file in the /etc/systemd/system/ directory.
  2. Copy the following text into the file.

    Modify the path and user fields according to the information provided during the broker instance creation. In the example below, the user amq-broker starts the broker service installed under the /var/opt/amq-broker/mybroker/ directory.

    [Unit]
    Description=AMQ Broker
    After=syslog.target network.target
    
    [Service]
    ExecStart=/var/opt/amq-broker/mybroker/bin/artemis run
    Restart=on-failure
    User=amq-broker
    Group=amq-broker
    
    # A workaround for Java signal handling
    SuccessExitStatus=143
    
    [Install]
    WantedBy=multi-user.target
  3. Open a terminal.
  4. Enable the broker service using the following command:

    sudo systemctl enable amq-broker
  5. Run the broker service using the following command:

    sudo systemctl start amq-broker

3.3.3. Starting a broker as a Windows service

If the broker is installed on Windows, you can run it as a service.

Procedure

  1. Open a command prompt to enter the commands
  2. Install the broker as a service with the following command:

    <broker_instance_dir>\bin\artemis-service.exe install
  3. Start the service by using the following command:

    <broker_instance_dir>\bin\artemis-service.exe start
  4. (Optional) Uninstall the service:

    <broker_instance_dir>\bin\artemis-service.exe uninstall
Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

Red Hat ドキュメントについて

Legal Notice

Theme

© 2026 Red Hat
トップに戻る