Centos7下RabbitMQ的安装与配置
具体按照步骤以此为准
- 第一步:安装最新版的erlang依赖
通过github设置版本号:https://github.com/rabbitmq/erlang-rpm
vi /etc/yum.repos.d/rabbitmq_erlang.repo
[rabbitmq_erlang] name=rabbitmq_erlang baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/$basearch repo_gpgcheck=1 gpgcheck=1 enabled=1 # PackageCloud's repository key and RabbitMQ package signing key gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt metadata_expire=300 [rabbitmq_erlang-source] name=rabbitmq_erlang-source baseurl=https://packagecloud.io/rabbitmq/erlang/el/7/SRPMS repo_gpgcheck=1 gpgcheck=0 enabled=1 # PackageCloud's repository key and RabbitMQ package signing key gpgkey=https://packagecloud.io/rabbitmq/erlang/gpgkey https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc sslverify=1 sslcacert=/etc/pki/tls/certs/ca-bundle.crt metadata_expire=300
- 第二步:查看线上版本号是否生效,如果生效执行安装即可
yum info erlange
执行安装命令
yum install erlang
- 第三步:安装RabbitMQ服务
https://bintray.com/rabbitmq/rpm/download_file?file_path=rabbitmq-server%2Fv3.7.x%2Fel%2F8%2Fnoarch%2Frabbitmq-server-3.7.22-1.el8.noarch.rpm
MQ基本操作
启动RabbitMQ服务 #service rabbitmq-server start 状态查看 #rabbitmqctl status 启用插件 #rabbitmq-plugins enable rabbitmq_management 重启服务 #service rabbitmq-server restart 添加帐号:name 密码:passwd #rabbitmqctl add_user name passwd 赋予其administrator角色 #rabbitmqctl set_user_tags name administrator 设置权限 #rabbitmqctl set_permissions -p / name ".*" ".*" ".*"
#后台方式启动
rabbitmq-server -detached 开启rabbitmq 服务
参考博客:https://blog.csdn.net/weixin_37641832/article/details/85266867#commentsedit
1.下载安装依赖环境
wget https://packages.erlang-solutions.com/erlang-solutions-1.0-1.noarch.rpm rpm -ivh erlang-solutions-1.0-1.noarch.rpm yum install erlang yum install socat
2.下载安装RabbitMQ
wget http://www.rabbitmq.com/releases/rabbitmq-server/v3.6.6/rabbitmq-server-3.6.6-1.el7.noarch.rpm yum install rabbitmq-server-3.6.6-1.el7.noarch.rpm
3.开启web管理后台
cd /usr/sbin/
./rabbitmq-plugins enable rabbitmq_management
4.配置RabbitMQ
- 创建用户名和密码
./rabbitmqctl add_user admin admin123
- 查看用户角色列表
./rabbitmqctl list_users
- 设置用户角色
./rabbitmqctl set_user_tags admin administrator
- 设置用户权限
./rabbitmqctl set_permissions -p "/" admin ".*" ".*" ".*"
- 登陆web端输入用户名和密码访问
最新同步更新地址:https://www.sunnyblog.top/
感谢您花时间阅读此篇文章,如果您觉得这篇文章你学到了东西也是为了犒劳下博主的码字不易不妨打赏一下吧,让博主能喝上一杯咖啡,在此谢过了!
如果您觉得阅读本文对您有帮助,请点一下左下角“推荐”按钮,您的“推荐”将是我最大的写作动力!另外您也可以选择【关注我】,可以很方便找到我!
本文版权归作者和博客园共有,来源网址:https://www.cnblogs.com/sunny1009 欢迎各位转载,但是未经作者本人同意,转载文章之后必须在文章页面明显位置给出作者和原文连接,否则保留追究法律责任的权利!