CentOS6.5安装ActiveMQ

来源:互联网 发布:数据库酒店管理系统 编辑:程序博客网 时间:2024/06/07 05:11

原文:http://blog.slogra.com/post-481.html

一、安装jdk

yum -y install java-1.8.0-openjdk

二、安装activemq
cd /usr/local/src
wget http://archive.apache.org/dist/activemq/apache-activemq/5.9.0/apache-activemq-5.9.0-bin.tar.gz
tar zxf apache-activemq-5.9.0-bin.tar.gz -C /usr/local/
mv /usr/local/apache-activemq-5.9.0 /usr/local/activemq
useradd activemq
chown -R activemq.activemq /usr/local/activemq

三、修改配置
vi /etc/profile
export PATH=/usr/local/activemq/bin:$PATH
保存后,执行

source /etc/profile


四、配置自启动:
vi /etc/init.d/activemq

#!/bin/bash## activemq       Starts ActiveMQ.### chkconfig: 345 88 12# description: ActiveMQ is a JMS Messaging Queue Server.### BEGIN INIT INFO# Provides: $activemq### END INIT INFO # the base directoryAMQ_DIR="/usr/local/activemq" # run the instance as userAMQ_USER=activemq CMD="nohup $AMQ_DIR/bin/activemq-admin" case "$1" in    start)        echo "Starting ActiveMQ "        /bin/su $AMQ_USER -c "$CMD $1 >/dev/null 2>&1 &"        ;;     stop)        echo "Shutting down ActiveMQ"        /bin/su $AMQ_USER -c "kill -9 `ps -u activemq -o pid=`"        ;;    restart)        $0 stop        $0 start        ;;    status)        echo "you wish – not yet implemented"        ;;    *)        echo "Usage: $0 {start|stop|restart|status}"    exit 1 ;;esac

保存并给与执行权限:

chmod +x /etc/init.d/activemq
service activemq start
chkconfig activemq on

直接输入http://ip:8161/admin/


若需要填用户名密码则admin/admin即可

0 0