Linux下安装部署ActiveMQ

1.下载

  • 地址 (提取码: 29gw)
  • 名称:apache-activemq-5.14.3-bin.tar.gz

2.解压文件

cd /soft

tar -zxvf apache-activemq-5.14.3-bin.tar.gz

3.解压完成之后,剪切apache-activemq-5.14.3/usr/local/下并修改名为activemq

mv apache-activemq-5.14.3 /usr/local/activemq

4.编辑env文件并设置JAVA_HOME的路径

vi /usr/local/activemq/bin/env

JAVA_HOME="/usr/local/java/jdk1.8.0_171"

5. 在 /etc/init.d下新建activemq文件

touch /etc/init.d/activemq

编辑vi activemq并写入以下脚本

#!/bin/sh
### BEGIN INIT INFO
# Provides:          activemq
# Required-Start:    $remote_fs $network $syslog
# Required-Stop:     $remote_fs $network $syslog
# Default-Start:     3 5
# Default-Stop:      0 1 6
# Short-Description: Starts ActiveMQ
# chkconfig: 2345 64 36
# Description:       Starts ActiveMQ Message Broker Server
### END INIT INFO
export ACTIVEMQ_HOME=/usr/local/activemq
case $1 in
    start)
        sh $ACTIVEMQ_HOME/bin/activemq start
    ;;
    stop)
        sh $ACTIVEMQ_HOME/bin/activemq stop
    ;;
    restart)
        sh $ACTIVEMQ_HOME/bin/activemq restart
    ;;
esac
exit 0

6.设置权限

chmod a+x /etc/init.d/activemq

7.添加到系统服务

chkconfig --add /etc/init.d/activemq

8.设置为开机自启动

chkconfig activemq on

9.启动

service activemq start
service activemq stop
service activemq restart

10.查看是否已启动activemq

 ps -ef|grep activemq 

11.开放8161端口永久保存到防火墙

firewall-cmd --zone=public --add-port=8161/tcp --permanent

12. 重启防火墙

firewall-cmd --reload

13.访问地址http://192.168.0.105:8161/admin/ 默认用户名密码admin/admin

image.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容