- 進入/tmp 目錄
- 使用wget下載下傳存檔
yum install wget
wget -c https://archive.apache.org/dist/activemq/5.15.8/apache-activemq-5.15.8-bin.tar.gz
- 提前存檔
tar -zxvf apache-activemq-5.15.8-bin.tar.gz -C /var
- 修改 activemq 的目錄名
mv /var/apache-activemq-5.15.8/ /var/avtivemq
. 啟動或停止
# 背景啟動
./bin/activemq start
./bin/activemq stop
- 做成系統服務
- 建立一個systemd服務檔案:vi
/usr/lib/systemd/system/activemq.service
- 放入内容
[Unit]
Description=ActiveMQ service
After=network.target
[Service]
Type=forking
ExecStart=/var/activemq/bin/activemq start
ExecStop=/var/activemq/bin/activemq stop
User=root
Group=root
Restart=always
RestartSec=9
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=activemq
[Install]
WantedBy=multi-user.target
3、 找到java指令所在的目錄 whereis java
4、設定activemq配置檔案/var/activemq/bin/env中的JAVA_HOME
# Location of the java installation
# Specify the location of your java installation using JAVA_HOME, or specify the
# path to the "java" binary using JAVACMD
# (set JAVACMD to "auto" for automatic detection)
JAVA_HOME="/usr/local/java/jdk1.8.0_181"
JAVACMD="auto"
- 通過systemctl管理activemq啟停
啟動activemq服務: systemctl start activemq
檢視服務狀态: systemctl status activemq
建立軟體連結:
ln -s /usr/lib/systemd/system/activemq.service /etc/systemd/system/multi-user.target.wants/activemq.service
開機自啟: systemctl enable activemq
檢測是否開啟成功(enable): systemctl list-unit-files |grep activemq
- 防火牆配置,Web管理端口預設為8161,通訊端口預設為61616
- 添加并重新開機防火牆
firewall-cmd --zone=public --add-port=8161/tcp --permanent
firewall-cmd --zone=public --add-port=61616/tcp --permanent
systemctl restart firewalld.service
#或者直接關閉防火牆:
systemctl stop firewalld.service
-
使用ActiveMQ的web管理平台
基于jetty運作,修改/var/activemq/conf/jetty.xml
http://ip:8161/admin
# 預設密碼
admin admin