Home / Articles / Messaging / activemq-artemis / 2.18.0 / create-standaloner-broker

Creating Standalone Broker Instance

Create Broker Instance

  • Open a new SSH terminal and login as activemq user
  • Switch to /var/lib directory where we will create our Broker Instance
  • # cd /var/lib/
  • Create Broker Instance named "ltsBroker"
  • You will be prompted to enter following two information. Enter as per the your setup.
    Please provide the default username:
    Please provide the default password:

    # /opt/apache-artemis-2.18.0/bin/artemis create ltsBroker Creating ActiveMQ Artemis instance at: /var/lib/ltsBroker --user: is a mandatory property! Please provide the default username: admin --password: is mandatory with this configuration: Please provide the default password: --allow-anonymous | --require-login: is a mandatory property! Allow anonymous access?, valid values are Y,N,True,False n Auto tuning journal ... done! Your system can make 10.87 writes per millisecond, your journal-buffer-timeout will be 92000 You can now start the broker by executing: "/var/lib/ltsBroker/bin/artemis" run Or you can run the broker in the background using: "/var/lib/ltsBroker/bin/artemis-service" start

Web Console Setup

  • Login as activemq user
  • Setup custom IP Address for web console. By default web console listens on localhost address.
  • Change following entry to replace localhost with your server IP address.

    # vi /var/lib/ltsBroker/etc/bootstrap.xml Search for: <web bind="http://localhost:8161" path="web"> Replace with: <web bind="http://192.168.50.73:8161" path="web">
    # vi /var/lib/ltsBroker/etc/jolokia-access.xml Search for: <allow-origin>*://localhost*</allow-origin> Replace with: <allow-origin>*://192.168.50.73*</allow-origin>

Start Broker Instance

  • Login as activemq user
  • There are Two ways for starting Artemis Broker.
    Starting in foreground
    Starting in background as a service.
  • Start Artemis in Foreground
  • # /var/lib/ltsBroker/bin/artemis run _ _ _ / \ ____| |_ ___ __ __(_) _____ / _ \| _ \ __|/ _ \ \/ | |/ __/ / ___ \ | \/ |_/ __/ |\/| | |\___ \ /_/ \_\| \__\____|_| |_|_|/___ / Apache ActiveMQ Artemis 2.18.0 2021-09-10 18:43:11,645 INFO [org.apache.activemq.artemis.integration.bootstrap] AMQ101000: Starting ActiveMQ Artemis Server 2021-09-10 18:43:11,813 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) 2021-09-10 18:43:11,878 INFO [org.apache.activemq.artemis.core.server] AMQ221012: Using AIO Journal 2021-09-10 18:43:12,060 INFO [org.apache.activemq.artemis.core.server] AMQ221057: Global Max Size is being adjusted to 1/2 of the JVM max size (-Xmx). being defined as 1,073,741,824 2021-09-10 18:43:12,091 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-server]. Adding protocol support for: CORE 2021-09-10 18:43:12,092 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-amqp-protocol]. Adding protocol support for: AMQP 2021-09-10 18:43:12,092 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-hornetq-protocol]. Adding protocol support for: HORNETQ 2021-09-10 18:43:12,093 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-mqtt-protocol]. Adding protocol support for: MQTT 2021-09-10 18:43:12,093 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-openwire-protocol]. Adding protocol support for: OPENWIRE 2021-09-10 18:43:12,094 INFO [org.apache.activemq.artemis.core.server] AMQ221043: Protocol module found: [artemis-stomp-protocol]. Adding protocol support for: STOMP 2021-09-10 18:43:12,309 INFO [org.apache.activemq.artemis.core.server] AMQ221034: Waiting indefinitely to obtain live lock 2021-09-10 18:43:12,309 INFO [org.apache.activemq.artemis.core.server] AMQ221035: Live Server Obtained live lock 2021-09-10 18:43:12,502 INFO [org.apache.activemq.artemis.core.server] AMQ221080: Deploying address DLQ supporting [ANYCAST] 2021-09-10 18:43:12,517 INFO [org.apache.activemq.artemis.core.server] AMQ221003: Deploying ANYCAST queue DLQ on address DLQ 2021-09-10 18:43:12,649 INFO [org.apache.activemq.artemis.core.server] AMQ221080: Deploying address ExpiryQueue supporting [ANYCAST] 2021-09-10 18:43:12,650 INFO [org.apache.activemq.artemis.core.server] AMQ221003: Deploying ANYCAST queue ExpiryQueue on address ExpiryQueue 2021-09-10 18:43:13,266 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started EPOLL Acceptor at 0.0.0.0:61616 for protocols [CORE,MQTT,AMQP,STOMP,HORNETQ,OPENWIRE] 2021-09-10 18:43:13,278 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started EPOLL Acceptor at 0.0.0.0:5445 for protocols [HORNETQ,STOMP] 2021-09-10 18:43:13,297 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started EPOLL Acceptor at 0.0.0.0:5672 for protocols [AMQP] 2021-09-10 18:43:13,322 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started EPOLL Acceptor at 0.0.0.0:1883 for protocols [MQTT] 2021-09-10 18:43:13,324 INFO [org.apache.activemq.artemis.core.server] AMQ221020: Started EPOLL Acceptor at 0.0.0.0:61613 for protocols [STOMP] 2021-09-10 18:43:13,365 INFO [org.apache.activemq.artemis.core.server] AMQ221007: Server is now live 2021-09-10 18:43:13,365 INFO [org.apache.activemq.artemis.core.server] AMQ221001: Apache ActiveMQ Artemis Message Broker version 2.18.0 [0.0.0.0, nodeID=7a466a93-1288-11ec-a679-08002713b8fc] 2021-09-10 18:43:13,852 INFO [org.apache.activemq.hawtio.branding.PluginContextListener] Initialized activemq-branding plugin 2021-09-10 18:43:13,958 INFO [org.apache.activemq.hawtio.plugin.PluginContextListener] Initialized artemis-plugin plugin 2021-09-10 18:43:14,484 INFO [io.hawt.HawtioContextListener] Initialising hawtio services 2021-09-10 18:43:14,512 INFO [io.hawt.system.ConfigManager] Configuration will be discovered via system properties 2021-09-10 18:43:14,519 INFO [io.hawt.jmx.JmxTreeWatcher] Welcome to Hawtio 2.13.5 2021-09-10 18:43:14,525 INFO [io.hawt.web.auth.AuthenticationConfiguration] Starting hawtio authentication filter, JAAS realm: "activemq" authorized role(s): "amq" role principal classes: "org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal" 2021-09-10 18:43:14,553 INFO [io.hawt.web.proxy.ProxyServlet] Proxy servlet is disabled 2021-09-10 18:43:14,559 INFO [io.hawt.web.servlets.JolokiaConfiguredAgentServlet] Jolokia overridden property: [key=policyLocation, value=file:/var/lib/ltsBroker/etc/jolokia-access.xml] 2021-09-10 18:43:14,743 INFO [org.apache.activemq.artemis] AMQ241001: HTTP Server started at http://192.168.50.73:8161 2021-09-10 18:43:14,743 INFO [org.apache.activemq.artemis] AMQ241002: Artemis Jolokia REST API available at http://192.168.50.73:8161/console/jolokia 2021-09-10 18:43:14,744 INFO [org.apache.activemq.artemis] AMQ241004: Artemis Console available at http://192.168.50.73:8161/console 2021-09-10 18:43:15,488 INFO [io.hawt.web.auth.LoginServlet] Hawtio login is using 1800 sec. HttpSession timeout 2021-09-10 18:43:16,296 INFO [io.hawt.web.auth.keycloak.KeycloakServlet] Keycloak integration is disabled
  • Start Artemis as a background process
  • # /var/lib/ltsBroker/bin/artemis-service start Starting artemis-service artemis-service is now running (4071)

Check Broker Instance Status

  • Check for artemis processes
  • # ps -ef | grep -i artemis activemq 4831 4812 4 18:43 pts/0 00:00:10 java -XX:+PrintClassHistogram -XX:+UseG1GC -XX:+UseStringDeduplication -Xms512M -Xmx2G -Dhawtio.disableProxy=true -Dhawtio.realm=activemq -Dhawtio.offline=true
    -Dhawtio.rolePrincipalClasses=org.apache.activemq.artemis.spi.core.security.jaas.RolePrincipal -Djolokia.policyLocation=file:/var/lib/ltsBroker/etc/jolokia-access.xml -Dhawtio.role=amq -Xbootclasspath/a:/opt/apache-artemis-2.18.0/lib/jboss-logmanager-2.1.10.Final.jar:/opt/apache-artemis-2.18.0/lib/wildfly-common-1.5.2.Final.jar -Djava.security.auth.login.config=/var/lib/ltsBroker/etc/login.config -classpath /opt/apache-artemis-2.18.0/lib/artemis-boot.jar -Dartemis.home=/opt/apache-artemis-2.18.0 -Dartemis.instance=/var/lib/ltsBroker -Djava.library.path=/opt/apache-artemis-2.18.0/bin/lib/linux-x86_64 -Djava.io.tmpdir=/var/lib/ltsBroker/tmp -Ddata.dir=/var/lib/ltsBroker/data -Dartemis.instance.etc=/var/lib/ltsBroker/etc -Djava.util.logging.manager=org.jboss.logmanager.LogManager -Dlogging.configuration=file:/var/lib/ltsBroker/etc//logging.properties org.apache.activemq.artemis.boot.Artemis run
  • Check the Artemis port status
  • # netstat -an | grep 8161 tcp6 0 0 192.168.50.73:8161 :::* LISTEN