CentOS 6.3 安装 ActiveMQ

1. tar -zvxf apache-activemq-5.9.1-bin.tar.gz

2. cd apache-activemq-5.9.1

3. cd bin

4. ./activemq start

5.配置开机启动ActiveMQ

#cd /etc/rc.d/init.d
#touch activemq
#chmod +x activemq
#vi activemq

添加如下内容:

#! /bin/sh
# chkconfig: 2345 70 30
# description: activemq

ACTIVEMQ_PATH=/usr/appdata/apache-activemq-5.9.1/bin/linux-x86-64
case "$1" in

      start)
          echo "start activemq service..."
          sh ${ACTIVEMQ_PATH}/activemq start
  ;;

       stop)
          echo "stop activemq service..."
          sh ${ACTIVEMQ_PATH}/activemq stop
          ;;

       restart)
          echo "restart activemq service..."
          sh ${ACTIVEMQ_PATH}/activemq restart
          ;;

        *)
          echo $"Usage: $0 {start}"
          exit 1
          ;;
esac

添加到开机启动服务:

chkconfig --add activemq
chkconfig activemq on
chkconfig --list              #查看开机启动的服务


然后就可以使用
#service activemq start|stop|restart
启动|停止|重启 啦




猜你喜欢

转载自maosheng.iteye.com/blog/2237866