您的位置:首页 > 运维架构 > Linux

CentOS6.5安装ActiveMQ

2016-01-16 16:40 302 查看
原文: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 directory
AMQ_DIR="/usr/local/activemq"

# run the instance as user
AMQ_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即可
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: