activemq入門安裝

  1. 進入/tmp 目錄
  2. 使用wget下載存檔
yum install wget 
wget -c https://archive.apache.org/dist/activemq/5.15.8/apache-activemq-5.15.8-bin.tar.gz
  1. 提前存檔
tar -zxvf apache-activemq-5.15.8-bin.tar.gz -C /var
  1. 修改 activemq 的目錄名
 mv /var/apache-activemq-5.15.8/ /var/avtivemq

. 啓動或停止

# 後臺啓動
./bin/activemq start
./bin/activemq stop


  1. 做成系統服務

    1. 創建一個systemd服務文件:vi
/usr/lib/systemd/system/activemq.service
  1. 放入內容
[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"


  1. 通過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

  1. 防火牆配置,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
  1. 使用ActiveMQ的web管理平臺
    基於jetty運行,修改/var/activemq/conf/jetty.xml
http://ip:8161/admin  
# 默認密碼
admin admin
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章