Apache ActiveMQ installation and use

Article directory

Apache ActiveMQ installation and use

environment

Ubuntu 20.04

download

Official website:https://activemq.apache.org/download-archives
For example, download version 5.14.4, apache-activemq-5.14 .4-bin.tar.gz, tested and no problem.

Install

sudo tar -xzvf apache-activemq-5.14.4-bin.tar.gz -C /usr/local

cd /usr/local
sudo mv apache-activemq-5.14.4 activemq

Configuration

ActiveMQ requires JDK environment support. After configuring the JDK.
In addition, it is best to configure the JDK location in the /usr/local/activemq/bin/activemq file, as follows:
Add at the beginning JAVA_HOME="JDK路径"
Insert image description here
Otherwise, sometimes the JDK will not be found and an error will be reported! Error message:

INFO: Loading '/usr/local/apache-activemq-5.14.4//bin/env'
ERROR: Configuration variable JAVA_HOME or JAVACMD is not defined correctly.
       (JAVA_HOME='', JAVACMD='java')

Why is it better to configure this?
Because although according to the official meaning, the JDK path in the environment variable will be found by default without configuration. But this premise is that the JDK environment variables are configured under /etc/profile and activemq can be started normally after switching the root user.
But in some scenarios, such as setting activemq to start automatically at boot, and logging in with a normal account by default when booting, activemq will report an error because it cannot find JAVA_HOME!

start up

# 切换root
su

# 启动
/usr/local/activemq/bin/activemq start

# 查看启动状态
/usr/local/activemq/bin/activemq status

# 停止
/usr/local/activemq/bin/activemq stop

# 重启
/usr/local/activemq/bin/activemq restart

Log in

Access localhost:8161, default username: admin, default password: admin

Guess you like

Origin blog.csdn.net/Acegem/article/details/129195164