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

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部