参考: https://mirrors.tuna.tsinghua.edu.cn/apache//activemq/5.15.3/apache-activemq-5.15.3-bin.tar.gz
注: 在安装activemq之前需要先安装jdk
1. 下载activemq并解压至 /opt目录下
tar xvzf apache-activemq-5.15.3-bin.tar.gz
mv apache-activemq-5.15.3 activemq-5.15.3
sudo mv activemq-5.15.3 /opt
2. 创建activemq的systemctl服务,创建并编辑 /usr/lib/systemd/system/activemq.service
sudo vim /usr/lib/systemd/system/activemq.service
## 添加如下内容
[Unit]
Description=activemq message queue
After=network.target
[Service]
Type=simple
Environment=JAVA_HOME=/opt/jdk1.8.0_161
PIDFile=/opt/activemq-5.15.3/data/activemq.pid
User=root
Group=root
ExecStart=/opt/activemq-5.15.3/bin/activemq start
ExecStop=/opt/activemq-5.15.3/bin/activemq stop
[Install]
WantedBy=multi-user.target
3. 使用systemctl启动activemq
sudo systemctl daemon-reload
sudo systemctl start activemq
## 以下命令设置开机启动activemq
sudo systemctl enable activemq
4. 使用浏览器登录 http://192.168.241.100:8161 进入activemq管理界面,账号密码: admin/admin