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

评论(0) 浏览(3789)

安装php的rabbitmq扩展amqp

2012-7-19 foooy

1、在https://github.com/alanxz/rabbitmq-c下载rabbitmq-c

https://github.com/alanxz/rabbitmq-c/releases/download/v0.5.0/rabbitmq-c-0.5.0.tar.gz
tar zxvf rabbitmq-c-0.5.0.tar.gz
cd rabbitmq-c-0.5.0
下载https://github.com/rabbitmq/rabbitmq-codegen
wget https://github.com/rabbitmq/rabbitmq-codegen/archive/rabbitmq_v3_3_3.tar.gz    #就下载到上面rabbitmq-c-0.5.0目录里面
tar zxvf rabbitmq_v3_3_3.tar.gz
mv rabbitmq-codegen-rabbitmq_v3_3_3 codegen

# 配置、编译、安装
autoreconf -i
./configure
make
make install


3、安装安装php的amqp扩展:

wget https://pecl.php.net/get/amqp-1.4.0.tgz
tar -zxvf amqp-1.4.0.tgz
cd amqp-1.4.0
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-amqp
make
make install
vim /usr/local/php/etc/php.ini
添加 extension = "amqp.so"
重启php即可


标签: linux centos 消息队列 rabbitmq amqp

评论(0) 浏览(585)

Powered by emlog 鄂ICP备14000186号-1 sitemap