安装RabbitMQ首先需要安装erlang运行环境


erlang 下载

官网:http://www.erlang.org/


# cd /opt/soft/erlang
# wget http://www.erlang.org/download/otp_src_R16B01.tar.gz


erlang 安装


# tar -xvf otp_src_R16B01.tar.gz
# cd otp_src_R16B01
# ./configure --prefix=/usr/local/erlang --enable-hipe --enable-threads --enable-smp-support --enable-kernel-poll
# make
# make install

erlang 环境配置


# vim /etc/profile
ERL_HOME=/opt/soft/erlang/otp_src_R16B01
PATH=$ERL_HOME/bin:$PATH
export ERL_HOME PATH
# source /etc/profile


安装完erlang后,输入erl命令显示如下,表示安装成功

Erlang R16B01 (erts-5.10.2) [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false]
Eshell V5.10.2  (abort with ^G)
1>


下面开始RabbitMQ的安装


官网下载页面 http://www.rabbitmq.com/install-generic-unix.html

# cd /opt/soft/rabbitmq
# wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.1.5/rabbitmq-server-generic-unix-3.1.5.tar.gz
# tar -xvf rabbitmq-server-generic-unix-3.1.5.tar.gzanzh


启动服务

# cd /opt/soft/rabbitmq/rabbitmq_server-3.1.5
启动
# sbin/rabbitmq-server start
停止
# sbin/rabbitmq-server stop


节点状态查看


# cd /opt/soft/rabbitmq/rabbitmq_server-3.1.5
# sbin/rabbitmqctl status


日志存放位置

# cd /opt/soft/rabbitmq/rabbitmq_server-3.1.5/var/log/rabbitmq


安装过程中常见问题:

1. 启动时出现下面错误描述

Error description:
   {error,
       {schema_integrity_check_failed,
           [{table_missing,mirrored_sup_childspec}]}}

通过删除/opt/soft/rabbitmq/rabbitmq_server-3.1.5/var/lib/rabbitmq/mnesia目录下所有文件,然后重新启动即可解决。