安装erlang
# vim /etc/yum.repos.d/rabbitmq-erlang.repo
[rabbitmq-erlang]
name=rabbitmq-erlang
baseurl=https://dl.bintray.com/rabbitmq/rpm/erlang/20/el/7
gpgcheck=1
gpgkey=https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc
repo_gpgcheck=0
enabled=1
# yum install erlang
安装rabbitmq服务
# rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc
# yum install rabbitmq-server-3.7.3-1.el7.noarch.rpm
开机启动
# systemctl enable rabbitmq-server.service
web插件
# rabbitmq-plugins enable rabbitmq_management
配置文件位置
node : rabbit@example
home dir : /var/lib/rabbitmq
config file(s) : /etc/rabbitmq/advanced.config
: /etc/rabbitmq/rabbitmq.conf
访问控制台
默认用户名和密码: guest/guest;
需要注意的是:guest用户仅仅提供localhost作为ip登录;
如果远程登录,如:http://192.168.241.101:15672/, 则会提示错误,登录不了:
# 如下是日志输出
=WARNING REPORT==== 21-Oct-2017::23:31:33 ===
HTTP access denied: user 'guest' - User can only log in via localhost
访问控制可参考:Access Control (Authentication, Authorisation) in RabbitMQ
# /etc/rabbitmq/rabbitmq.conf
loopback_users = none
到此搭建成功
权限配置
创建用户
# rabbitmqctl add_user admin 123456
赋予角色
# rabbitmqctl set_user_tags admin administrator
查看用户
# rabbitmqctl list_users
参考文档
http://blog.csdn.net/zyz511919766/article/details/42292655
错误
- [error] Error when reading /var/lib/rabbitmq/.erlang.cookie: eacces
# chown rabbitmq:rabbitmq /var/lib/rabbitmq/.erlang.cookie