我们这个版本按照官方的不能正确安装。
1、安装erlang(官网地址http://www.erlang.org )
rabbitmq是erlang语言编写的,我们要安装erlang语言环境
- # mkdir mq
- # cd mq/
- # wget http://www.erlang.org/download/otp_src_R15B01.tar.gz
- # tar -zxvf otp_src_R15B01.tar.gz
- # cd otp_src_R15B01
- # yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel
- # ./configure --prefix=/usr/local/erlang --enable-hipe --enable-threads --enable-smp-support --enable-kernel-poll
- # make;make install
# mkdir mq
# cd mq/
# wget http://www.erlang.org/download/otp_src_R15B01.tar.gz
# tar -zxvf otp_src_R15B01.tar.gz
# cd otp_src_R15B01
# yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel
# ./configure --prefix=/usr/local/erlang --enable-hipe --enable-threads --enable-smp-support --enable-kernel-poll
# make;make install
配置环境
# vim /etc/profile
ERL_HOME=/usr/local/erlang
PATH=$ERL_HOME/bin:$PATH
export ERL_HOME PATH
# source /etc/profile
然后输入erl,出现erlang shell,如下:
2、安装rabbitmq
#wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.0.1/rabbitmq-server-3.0.1.tar.gz
#tar xzvf rabbitmq-server-3.0.1.tar.gz
#cd rabbitmq-server-3.0.1
#make TARGET_DIR=/opt/rabbitmq SBIN_DIR=/opt/rabbitmq/sbin MAN_DIR=/opt/rabbitmq/man DOC_INSTALL_DIR=/opt/rabbitmq/doc install
如果报"/bin/sh: line 1: xmlto: command not found"错误,执行"yum -y install xmlto".
3、安装web插件
# rabbitmq-plugins enable rabbitmq_management
The following plugins have been enabled:
mochiweb
webmachine
rabbitmq_mochiweb
amqp_client
rabbitmq_management_agent
rabbitmq_management
Plugin configuration has changed. Restart RabbitMQ for changes to take effect.
4、启动服务
# rabbitmq-server start &
5、检查rabbitmq状态
查进程:
ps aux|grep rabbit
查端口:
netstat -ntulp|grep 5672
查状态:
/opt/rabbitmq/sbin/rabbitmqctl status
6、页面验证
http://service-ip:55672