返回顶部

activemq安装

安装jdk8:
[admin@xfyun-bj-tools1 admin]$ tar xf downloads/jdk-8u192-linux-x64.tar.gz
[admin@xfyun-bj-tools1 admin]$ mv jdk1.8.0_192 jdk1.8.0

安装activemq:
[admin@xfyun-bj-tools1 admin]$ tar xf apache-activemq-5.11.1-bin.tar.gz
[admin@xfyun-bj-tools1 admin]$ sudo vim /etc/profile
export JAVA_HOME=/work/admin/jdk1.8.0
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export ACTIVEMQ_HOME=/work/admin/apache-activemq-5.11.1
export PATH=${JAVA_HOME}/bin:$PATH:$ACTIVEMQ_HOME/bin

[admin@xfyun-bj-tools1 admin]$ source /etc/profile

配置开机启动:
[admin@xfyun-bj-tools1 admin]$ cat /etc/init.d/activemq
#!/bin/sh
#
# /etc/init.d/activemq
# chkconfig: 345 63 37
# description: activemq servlet container.
# processname: activemq 5.15.2

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

export JAVA_HOME=/work/admin/jdk1.8.0
export ACTIVEMQ_HOME=/work/admin/apache-activemq-5.11.1

case $1 in
start)
sh $ACTIVEMQ_HOME/bin/activemq start
;;
stop)
sh $ACTIVEMQ_HOME/bin/activemq stop
;;
status)
sh $ACTIVEMQ_HOME/bin/activemq status
;;
restart)
sh $ACTIVEMQ_HOME/bin/activemq stop
sleep 1
sh $ACTIVEMQ_HOME/bin/activemq start
;;
esac
exit 0


添加执行权限
[admin@xfyun-bj-tools1 admin]$ sudo chmod +x /etc/init.d/activemq

开机启动:
[admin@xfyun-bj-tools1 admin]$ sudo systemctl enable activemq
[admin@xfyun-bj-tools1 admin]$ systemctl is-enabled activemq
activemq.service is not a native service, redirecting to /sbin/chkconfig.
Executing /sbin/chkconfig activemq --level=5
enabled

 

posted @ 2019-10-22 10:33  凡间的精灵  阅读(188)  评论(0编辑  收藏  举报