安装Erlang
- 安装Erlang22 注意与RabbitMQ的版本对应
$ sudo apt-get install erlang
- 测试
$ erl
Erlang/OTP 22 [erts-10.6.1] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]
Eshell V10.6.1 (abort with ^G)
1>
安装RabbitMQ
- 创建RabbitMQ文件夹用来安装
$ cd /usr/local
$ mkdir rabbitmq
$ cd rabbitmq
- 下载RabbitMQ 3.8.2版本
$ sudo wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.2/rabbitmq-server-generic-unix-3.8.2.tar.xz
- 解压
$ sudo tar xvJf rabbitmq-server-generic-unix-3.8.2.tar.xz
- 启动RabbitMQ
$ cd sbin
$ sudo ./rabbitmq-server -detached
## ## RabbitMQ 3.8.2
## ##
########## Copyright (c) 2007-2019 Pivotal Software, Inc.
###### ##
########## Licensed under the MPL 1.1. Website: https://rabbitmq.com
Doc guides: https://rabbitmq.com/documentation.html
Support: https://rabbitmq.com/contact.html
Tutorials: https://rabbitmq.com/getstarted.html
Monitoring: https://rabbitmq.com/monitoring.html
Logs: /usr/local/rabbitmq/rabbitmq_server-3.8.2/var/log/rabbitmq/rabbit@work01.log
/usr/local/rabbitmq/rabbitmq_server-3.8.2/var/log/rabbitmq/rabbit@work01_upgrade.log
Config file(s): (none)
Starting broker... completed with 0 plugins.
- 配置RabbitMQ环境变量
- 如果想开启web管理界面,需执行以下命令:
$ sudo ./rabbitmq-plugins enable rabbitmq_management
Enabling plugins on node rabbit@work01:
rabbitmq_management
The following plugins have been configured:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
Applying plugin configuration to rabbit@work01...
The following plugins have been enabled:
rabbitmq_management
rabbitmq_management_agent
rabbitmq_web_dispatch
set 3 plugins.
Offline change; changes will take effect at broker restart.
使用浏览器访问http:///ip:15672会进入登陆页面
但是使用RabbitMQ默认的用户guest/guest无法登陆,提示告诉你这个用户只能在RabbitMQ服务部署的本机登陆,如下所示
只需修改rabbitmq_server-3.8.2/ebin/rabbit.app文件的下面一行
{loopback_users, [<<"guest">>]} --> {loopback_users, []}
再次登录即可进入管理界面