- 安装rabbitmq前要准备的基础环境
yum install build-essential openssl openssl-devel unixODBC unixODBC-devel make gcc gcc-c++ kernel-devel m4 ncurses-devel tk tc xz tcp_wrappers
- 需下载的安装文件如下
## erlang
wget www.rabbitmq.com/releases/erlang/erlang-18.3-1.el7.centos.x86_64.rpm
## 秘钥包
wget http://repo.iotti.biz/CentOS/7/x86_64/socat-1.7.3.2-5.el7.lux.x86_64.rpm
## rabbitmq
wget www.rabbitmq.com/releases/rabbitmq-server/v3.6.5/rabbitmq-server-3.6.5-1.noarch.rpm
注意事项:
erlang的版本会影响到rabbitmq的安装,两者有个版本对照
查看对照的地址:http://www.rabbitmq.com/which-erlang.html
- 下载文件后进行安装,依次执行以下命令
rpm -ivh erlang-18.3-1.el7.centos.x86_64.rpm
rpm -ivh socat-1.7.3.2-1.1.el7.x86_64.rpm
rpm -ivh rabbitmq-server-3.6.5-1.noarch.rpm
- 需要简单更改配置文件
vi /usr/lib/rabbitmq/lib/rabbitmq_server-3.6.5/ebin/rabbit.app
更改为如下。至此,rabbitmq已成功安装
5. 启动操作rabbitmq的基本命令
1 启动rabbitmq:rabbitmq-service start
2 关闭rabbitmq:rabbitmq-service stop
3 启动监控管理器:rabbitmq-plugins enable rabbitmq_management
4 关闭监控管理器:rabbitmq-plugins disable rabbitmq_management
5 查看所有的队列:rabbitmqctl list_queues
6 清除所有的队列:rabbitmqctl reset
7 关闭应用:rabbitmqctl stop_app
8 启动应用:rabbitmqctl start_app