centos 6.3 rabbitmq 설치

2359 단어 rabbitmq
# install erlangwget -O /etc/yum.repos.d/epel-erlang.repo http://repos.fedorapeople.org/repos/peter/erlang/epel-erlang.repo && yum -y install erlang
# install dependencies
yum -y install libxslt nc xmlto unzip
# install rabbitmq-serverwget http://www.rabbitmq.com/releases/rabbitmq-server/v3.0.4/rabbitmq-server-3.0.4.tar.gztar zxvf rabbitmq-server-3.0.4.tar.gz && cd rabbitmq-server-3.0.4 # modify Makefile:# add three vars >> # SBIN_DIR = /usr/sbin# MAN_DIR = /usr/share/man# TARGET_DIR= /opt/middlewares/rabbitmq
sed -i '1i\SBIN_DIR = /usr/sbinMAN_DIR = /usr/share/manTARGET_DIR= /opt/middlewares/rabbitmq' Makefilemake && make install
 
mkdir -p /etc/rabbitmq && cd /etc/rabbitmqcreate file : rabbitmq-env.conf content >> RABBITMQ_NODENAME=rabbitmq@localhost
 
# launch rabbitmq serverrabbitmq-server &
 
# add user/vhost, set permissionsrabbitmqctl add_user test testrabbitmqctl add_vhost test_hostrabbitmqctl set_permissions -p test_host test ".*" ".*" ".*"# create file rabbitmq, add it to /etc/init.d/
# forward: http://lovekongnan.blog.163.com/blog/static/960419232012102691437965/
# or use this:
content >>
        #!/bin/sh
	#
	# rabbitmq-server RabbitMQ broker
	#
	# chkconfig: - 80 05
	# description: Enable AMQP service provided by RabbitMQ
	#

	### BEGIN INIT INFO
	# Provides:          rabbitmq-server
	# Required-Start:    $remote_fs $network
	# Required-Stop:     $remote_fs $network
	# Description:       RabbitMQ broker
	# Short-Description: Enable AMQP service provided by RabbitMQ broker
	### END INIT INFO

	# Source function library.
	. /etc/init.d/functions
	export HOME=/root
	PATH=/bin:/usr/bin:/sbin:/usr/sbin
	DAEMON=/opt/middlewares/rabbitmq/sbin/rabbitmq-server
	CONTROL=/opt/middlewares/rabbitmq/sbin/rabbitmqctl

	case "$1" in
	start)
		$DAEMON &
	;;
	stop)
		$CONTROL stop
	esac

 
chmod 755 rabbitmqchkconfig rabbitmq on
 
reboot
#end

좋은 웹페이지 즐겨찾기