CentOS7下ActitMq安装和自启动配置

5 篇文章 0 订阅

1. 下载ActiveMQ,http://activemq.apache.org/activemq-5152-release

2.上传到Centos上

[root@localhost 20190903]# ls

apache-activemq-5.15.2-bin.tar.gz  jdk-8u211-linux-x64.tar.gz  redis-3.0.6.tar.gz

3.创建activemq的解压目录

[root@localhost local]# mkdir activemq

3.解压文件apache-activemq-5.15.2-bin.tar.gz

[root@localhost 20190903]# tar -zxvf /usr/20190903/apache-activemq-5.15.2-bin.tar.gz -C /usr/local/activemq

4.启动ActiveMQ

[root@localhost bin]# cd /usr/local/activemq/apache-activemq-5.15.2/bin

[root@localhost bin]# ./activemq start

5.验证时候启动成功

[root@localhost bin]# ./activemq start

在浏览器输入:http://192.168.126.139:8161/

 

6.开启自动重启设置,/etc/init.d/目录增加增加activemq文件,文件内容为:

 [root@localhost init.d]# vi activemq

在activemq中增加如下所示

#!/bin/sh
# /etc/init.d/activemq
# chkconfig: 345 63 37
# description: Auto start ActiveMQ
# processname: activemq 5.15.2


# Source function library.
#. /etc/init.d/functions
# source networking configuration.
#. /etc/sysconfig/network


export JAVA_HOME=/usr/java/jdk1.8.0_211
export CATALINA_HOME=/usr/local/activemq/apache-activemq-5.15.2


case $1 in
    start)
        sh $CATALINA_HOME/bin/activemq start
    ;;
    stop)
        sh $CATALINA_HOME/bin/activemq stop
    ;;
    restart)
        sh $CATALINA_HOME/bin/activemq stop
        sleep 1
        sh $CATALINA_HOME/bin/activemq start
    ;;
	status)
        sh $CATALINA_HOME/bin/activemq status
    ;;

esac
exit 0

7. 对activemq文件授予执行权限

[root@localhost init.d]# chmod 777 activemq

8.设置开机启动并启动activemq

[root@localhost init.d]# chkconfig activemq on

9.测试开机自动启动

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值