centos6 64位安装 安装RabbitMQ消息服务器

2014-2-24 foooy linux

 Rabbitmq 是用 erlang 语言写的,所以使用还要安装 Erlang。

安装 erlang 还要安装 python 与 simplejson,我环境中已经安装了 python 2.6.4,simplejson 只要 easy_install 就可以了

1、安装easy_install (已经安装了的忽略该步骤)

yum install -y python-setuptools python-setuptools-devel
 2、安装simplejson
easy_install simplejson
3、安装erlang
wget http://www.erlang.org/download/otp_src_R13B04.tar.gz
tar -zxf otp_src_R13B04.tar.gz
cd otp_src_R13B04
./configure
make && make install

如果提示:

configure: error: No curses library functions found

configure: error: /bin/sh '/root/otp_src_R15B01/erts/configure' failed for erts

执行:

yum -y install ncurses-devel

 

4、安装rabbitmq

yum install xmlto
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.2.3/rabbitmq-server-3.2.3.tar.gz
tar zxvf rabbitmq-server-3.2.3.tar.gz
cd rabbitmq-server-3.2.3
make TARGET_DIR=/usr/local/rabbitmq SBIN_DIR=/usr/local/rabbitmq/sbin MAN_DIR=/usr/local/rabbitmq/man DOC_INSTALL_DIR=/usr/local/rabbitmq/doc
make TARGET_DIR=/usr/local/rabbitmq SBIN_DIR=/usr/local/rabbitmq/sbin MAN_DIR=/usr/local/rabbitmq/man DOC_INSTALL_DIR=/usr/local/rabbitmq/doc install
5、启动 由于CentOS 6.2默认启动了qpidd这个消息中间件,所以占掉了5672端口(会与rabbitmq冲突),所以要先暂时停掉
service qpidd stop
/usr/local/rabbitmq/sbin/rabbitmq-server -detached #启动
/usr/local/rabbitmq/sbin/rabbitmqctl status #查看运行状态
/usr/local/rabbitmq/sbin/rabbitmqctl stop #停止
/usr/local/rabbitmq/sbin/rabbitmqctl rotate_logs #循环日志文件

启动时如果提示:ERROR: epmd error for host "****": timeout (timed out establishing tcp connection)

是因为主机名和ip不匹配了,需要更改/etc/hosts

127.0.0.1 yournewhostname (一般默认会有增加一个就可以了)

6、启用插件可在线管理队列
mkdir -p /etc/rabbitmq
/usr/local/rabbitmq/sbin/rabbitmq-plugins enable rabbitmq_management 
/usr/local/rabbitmq/sbin/rabbitmq-plugins list #查看已安装插件

然后可以通过http://127.0.0.1:55672/在线管理队列 用户名密码都为guest


点击查看原图

 

点击查看原图

 

 

标签: centos 消息队列 python rabbitmq

发表评论:

Powered by emlog 鄂ICP备14000186号-1 sitemap