https://www.codeproject.com/Articles/5267360/Install-Configure-ActiveMQ-Artemis-on-Linux-Ubuntu
- Check java version installed:
$ java -version
- Check environment variable JAVA_HOME value:
$ echo $JAVA_HOME
- 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
-
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
-
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
- Create a New Linux User Group
activemq
:
$ sudo addgroup --quiet --system activemq
- Create a New Linux User
activemq
$ sudo adduser --quiet --system --ingroup activemq --no-create-home --disabled-password activemq
- Change the Ownership of
/opt/apache-artemis-2.17.0
Directory:
$ sudo chown -R activemq:activemq /opt/apache-artemis-2.17.0/
- 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.
- 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
- 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
Changed folder's ownership and testing
Adding current user ($USER) to activemq group
And reboot your laptop