activemq安装及自启动方法

来源:互联网 发布:南京行知幼儿园怎么样 编辑:程序博客网 时间:2024/05/18 17:45

参考 魔夜听剑的博客,网址:http://www.cnblogs.com/zhi-leaf/p/5932011.html

linux下下周tar.gz包

之后解压:

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


解压后,进入bin目录,根据linux系统版本(通过uname -a),选择启动,如linux-x86-32或者linux-x86-64

如:

cd apache-activemq-5.14.1/bin/linux-x86-64/
之后
./activemq start
即可启动


添加启动项,让其自启动

1 创建连接:

ln -sf /dev/activeMQ/apache-activemq-5.14.1/bin/linux-x86-64/activemq /etc/init.d/
update-rc.d activemq defaults

对于/dev/activeMQ/apache-activemq-5.14.1/bin/linux-x86-64/activemq中的activemq,正式文本中需要添加下面的:
#### BEGIN INIT INFO
# Provides:             activemq
# Required-Start:       $remote_fs $syslog
# Required-Stop:        $remote_fs $syslog
# Default-Start:        2 3 4 5
# Default-Stop:         0 6
# chkconfig: 2345 64 36
# Short-Description:    ActiveMQ server
### END INIT INFO

即根据实际把上面的进行改写,亲测,无需修改上面的名称。


2 直接进行测试:

service activemq start
service activemq stop

service activemq status

添加启动项:

update-rc.d   activemq defaults  

sysv-rc-conf 进行查看该服务是否自启



之后在/etc/init.d目录增加activemq文件


cd /etc/init.d/vi activemq


#!/bin/sh
#
# /etc/init.d/activemq
# chkconfig: 345 63 37
# description: activemq servlet container.
# processname: activemq 5.14.1
 
# Source function library.
#. /etc/init.d/functions
# source networking configuration.
#. /etc/sysconfig/network
 
#export JAVA_HOME=/
export CATALINA_HOME=/usr/local/activemq/apache-activemq-5.14.1
 
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
    ;;
 
esac
exit 0

赋予权限:

chmod 777 activemq

设置开启    启动activemq

chkconfig activemq onservice activemq start

查看activemq状态

service activemq status

其他和关闭activemq服务

service activemq startservice activemq stop

   设置开机启动或不启动activemq服务

chkconfig activemq onchkconfig activemq off


activemq修改内存信息:

/activeMQ/apache-activemq-5.14.1/bin/linux-x86-64下


wrapper.conf  中
wrapper.java.maxmemory=1024  修改为
wrapper.java.maxmemory=512



原创粉丝点击