当前位置:   article > 正文

centos7安装rabbitmq3.7.3

rabbitmq3.7.3

安装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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

安装rabbitmq服务

# rpm --import https://www.rabbitmq.com/rabbitmq-release-signing-key.asc
# yum install rabbitmq-server-3.7.3-1.el7.noarch.rpm
  • 1
  • 2

开机启动

# systemctl enable rabbitmq-server.service
  • 1

web插件

#  rabbitmq-plugins enable rabbitmq_management
  • 1

配置文件位置

node           : rabbit@example
home dir       : /var/lib/rabbitmq
config file(s) : /etc/rabbitmq/advanced.config
               : /etc/rabbitmq/rabbitmq.conf
  • 1
  • 2
  • 3
  • 4

访问控制台

默认用户名和密码: 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
  • 1
  • 2
  • 3

访问控制可参考:Access Control (Authentication, Authorisation) in RabbitMQ

# /etc/rabbitmq/rabbitmq.conf
loopback_users = none
  • 1
  • 2

到此搭建成功
这里写图片描述

权限配置

创建用户

 # rabbitmqctl add_user  admin  123456
  • 1

赋予角色

# rabbitmqctl set_user_tags admin administrator 
  • 1

查看用户

# rabbitmqctl list_users
  • 1

参考文档

http://blog.csdn.net/zyz511919766/article/details/42292655
  • 1

错误

  1. [error] Error when reading /var/lib/rabbitmq/.erlang.cookie: eacces
# chown rabbitmq:rabbitmq /var/lib/rabbitmq/.erlang.cookie
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/神奇cpp/article/detail/919284
推荐阅读
相关标签
  

闽ICP备14008679号