Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save caisback/7ef4d8b1c0b7d3a62274640df732f856 to your computer and use it in GitHub Desktop.
Save caisback/7ef4d8b1c0b7d3a62274640df732f856 to your computer and use it in GitHub Desktop.
Ubuntu 20.04 LTS - Installing ActiveMQ Artemis 2.17.0 with AdoptOpenJDK-8

Reference:

https://www.codeproject.com/Articles/5267360/Install-Configure-ActiveMQ-Artemis-on-Linux-Ubuntu

  1. Check java version installed:
$ java -version
  1. Check environment variable JAVA_HOME value:
$ echo $JAVA_HOME
  1. If the result of the above command is a blank line, perform this step else skip it
  • Check current directory:

    $ pwd
    /home/bboy
  • Ubuntu 20.04, the jdks are installed under /usr/lib/jvm:

    $ cd /usr/lib/jvm/
  • Append $JAVA_HOME as environment variable by editing /etc/bash.bashrc using nano text editor

    $ sudo nano /etc/bash.bashrc 
    • Add the following line at the bottom of file (/etc/bash.bashrc):
    export JAVA_HOME=/usr/lib/jvm/adoptopenjdk-8-hotspot-amd64
    
    • Exit and Save:
    Ctrl + X, then Y
    
  • Apply your changes:

    $ source /etc/bash.bashrc
  • Testing, should output => /usr/lib/jvm/adoptopenjdk-8-hotspot-amd64

    $ echo $JAVA_HOME
  1. Download the latest version on https://activemq.apache.org/components/artemis/download/ As the time if this writing apache-artemis-2.17.0-bin.tar.gz is the latest And save it to /home/<your_user_here>/Downloads folder

  2. Extract the tar.gz file on folder /opt:

  • Change directory to /opt
$ cd /opt/
  • Check available files and folders:
$ ls
  • Extract the downloaded file apache-artemis-2.17.0-bin.tar.gz located on your Downloads folder:
$ sudo tar -xzf /home/<your_user_here>/Downloads/apache-artemis-2.17.0-bin.tar.gz 
  • Check if successful: ls command should return a folder apache-artemis-2.17.0 on the list:
$ ls
  1. Create a New Linux User Group activemq:
$ sudo addgroup --quiet --system activemq
  1. Create a New Linux User activemq
$ sudo adduser --quiet --system --ingroup activemq --no-create-home --disabled-password activemq
  1. Change the Ownership of /opt/apache-artemis-2.17.0 Directory:
$ sudo chown -R activemq:activemq /opt/apache-artemis-2.17.0/
  1. Check if artemis is working:
$ cd apache-artemis-2.17.0/bin
$ ./artemis

usage: artemis <command> [<args>]

The most commonly used artemis commands are:
    address     Address tools group (create|delete|update|show) (example ./artemis address create)
    browser     It will browse messages on an instance
    check       Check tools group (node|queue) (example ./artemis check node)
    consumer    It will consume messages from an instance
    create      creates a new broker instance
    data        data tools group (print) (example ./artemis data print)
    help        Display help information
    mask        mask a password and print it out
    migrate1x   Migrates the configuration of a 1.x Artemis Broker
    producer    It will send messages to an instance
    queue       Queue tools group (create|delete|update|stat|purge) (example ./artemis queue create)
    transfer    Moves Messages from one destination towards another destination

See 'artemis help <command>' for more information on a specific command.
  1. Create the Broker (ActiveMQ-Artemis-217)
    In this setup, the broker will have the following properties:
  • Name: ActiveMQ-Artemis-217
  • Administrator UID: admin
  • Administrator PW: admin

the installation will have an additional prompt (just type "Y" and press Enter):

$ sudo ./artemis create ActiveMQ-Artemis-217 --user=admin --password=admin --http-host 0.0.0.0 --relax-jolokia
[sudo] password for bboy: 
Creating ActiveMQ Artemis instance at: /opt/apache-artemis-2.17.0/bin/ActiveMQ-Artemis-217

--allow-anonymous | --require-login: is a mandatory property!
Allow anonymous access?, valid values are Y,N,True,False
Y

Auto tuning journal ...
done! Your system can make 19.23 writes per millisecond, your journal-buffer-timeout will be 52000

You can now start the broker by executing:  

   "/opt/apache-artemis-2.17.0/bin/ActiveMQ-Artemis-217/bin/artemis" run

Or you can run the broker in the background using:

   "/opt/apache-artemis-2.17.0/bin/ActiveMQ-Artemis-217/bin/artemis-service" start
  1. Start the Broker Instance (ActiveMQ-Artemis-217)
  • You can now start the broker by executing:
$ sudo "/opt/apache-artemis-2.17.0/bin/ActiveMQ-Artemis-217/bin/artemis" run
  • Or you can run the broker in the background using (NOT WORKING ON Ubuntu 20.04)
$ sudo "/opt/apache-artemis-2.17.0/bin/ActiveMQ-Artemis-217/bin/artemis-service" start
@adithyan2021
Copy link

how can we configure ip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment