Java充电社
专辑
博文
联系我
本人继续续收门徒,亲手指导
RabbitMQ第3篇:RabbitMQ安装
相关专辑:
RabbitMQ专题
<div style="display:none"></div> 对应视频:<a href="https://www.bilibili.com/video/BV1cb4y1o7zz?p=10" target="_blank">https://www.bilibili.com/video/BV1cb4y1o7zz?p=10</a> ## 3.1、官网地址 <a target="_blank" href="https://www.rabbitmq.com/download.html">https://www.rabbitmq.com/download.html</a> ## 3.2、文件上传 百度网盘地址: ```java 链接:https://pan.baidu.com/s/1j0EB7-BMkUzXsj-rgf9AQQ?pwd=yyds 提取码:yyds ``` 上传到/usr/local/software 目录下(如果没有 software 需要自己创建) ![](https://itsoku.oss-cn-hangzhou.aliyuncs.com/itsoku/blog/article/381/9bd8c313-d2fd-41d4-9339-3e538f834610.png) ## 3.3、安装文件(分别按照以下顺序安装) ```shell rpm -ivh erlang-21.3-1.el7.x86_64.rpm yum install socat -y rpm -ivh rabbitmq-server-3.8.8-1.el7.noarch.rpm ``` ## 3.4、常用命令(按照以下顺序执行) #### 1)添加开机启动 RabbitMQ 服务 ```shell chkconfig rabbitmq-server on ``` #### 2)启动服务 ```shell /sbin/service rabbitmq-server start ``` #### 3)查看服务状态 ```shell /sbin/service rabbitmq-server status ``` ![](https://itsoku.oss-cn-hangzhou.aliyuncs.com/itsoku/blog/article/381/34389a37-5a1e-411d-bb46-cdbec1ff3202.png) #### 4)停止服务(选择执行) ```shell /sbin/service rabbitmq-server stop ``` #### 5)开启 web 管理插件 ```shell rabbitmq-plugins enable rabbitmq_management ``` #### 6)访问管理台 rabbitmq提供的有web版的管理系统,地址`http://localhost:15672/` 用默认账号密码(guest)访问地址`http://localhost:15672/`出现权限问题,需要创建一个用户,如何整?向下看 ![](https://itsoku.oss-cn-hangzhou.aliyuncs.com/itsoku/blog/article/381/1b5416e7-3529-4f17-b521-e2f2346bdce3.png) ## 3.5、添加一个新的用户 ### 1)创建账号 ```shell rabbitmqctl add_user admin 123 ``` ### 2)设置用户角色 ```shell rabbitmqctl set_user_tags admin administrator ``` ### 3)设置用户权限 语法 ```shell set_permissions [-p <vhostpath>] <user> <conf> <write> <read> ``` 下面给admin赋权,用户 user_admin 具有/vhost1 这个 virtual host 中所有资源的配置、写、读权限 ```shell rabbitmqctl set_permissions -p "/" admin "." "." ".*" ``` ### 4)查看当前用户和角色 ```shell [root@test001 mysoft]# rabbitmqctl list_users Listing users ... user tags admin [administrator] guest [administrator] ``` ## 3.6、再次利用 admin 用户登录 ![](https://itsoku.oss-cn-hangzhou.aliyuncs.com/itsoku/blog/article/381/28bf6133-5e7c-4534-8bea-3cc958f992e0.png) ![](https://itsoku.oss-cn-hangzhou.aliyuncs.com/itsoku/blog/article/381/58635fc0-53f2-46f5-9641-77c42919e23a.png) ## 3.7、重新设置RabbitMQ命令 ### 1)首先关闭RabbitMQ ```shell rabbitmqctl stop_app ``` ### 2)还原 ``` rabbitmqctl reset ``` ### 3)启动 ```shell rabbitmqctl start_app ``` <a style="display:none" target="_blank" href="https://mp.weixin.qq.com/s/_S1DD2JADnXvpexxaBwLLg" style="color:red; font-size:20px; font-weight:bold">继续收门徒,亲手带,月薪 4W 以下的可以来找我</a> ## 最新资料 1. <a href="https://mp.weixin.qq.com/s?__biz=MzkzOTI3Nzc0Mg==&mid=2247484964&idx=2&sn=c81bce2f26015ee0f9632ddc6c67df03&scene=21#wechat_redirect" target="_blank">尚硅谷 Java 学科全套教程(总 207.77GB)</a> 2. <a href="https://mp.weixin.qq.com/s?__biz=MzkwOTAyMTY2NA==&mid=2247484192&idx=1&sn=505f2faaa4cc911f553850667749bcbb&scene=21#wechat_redirect" target="_blank">2021 最新版 Java 微服务学习线路图 + 视频</a> 3. <a href="https://mp.weixin.qq.com/s?__biz=MzkwOTAyMTY2NA==&mid=2247484573&idx=1&sn=7f3d83892186c16c57bc0b99f03f1ffd&scene=21#wechat_redirect" target="_blank">阿里技术大佬整理的《Spring 学习笔记.pdf》</a> 4. <a href="https://mp.weixin.qq.com/s?__biz=MzkwOTAyMTY2NA==&mid=2247484544&idx=2&sn=c1dfe907cfaa5b9ae8e66fc247ccbe84&scene=21#wechat_redirect" target="_blank">阿里大佬的《MySQL 学习笔记高清.pdf》</a> 5. <a href="https://mp.weixin.qq.com/s?__biz=MzkwOTAyMTY2NA==&mid=2247485167&idx=1&sn=48d75c8e93e748235a3547f34921dfb7&scene=21#wechat_redirect" target="_blank">2021 版 java 高并发常见面试题汇总.pdf</a> 6. <a href="https://mp.weixin.qq.com/s?__biz=MzkwOTAyMTY2NA==&mid=2247485664&idx=1&sn=435f9f515a8f881642820d7790ad20ce&scene=21#wechat_redirect" target="_blank">Idea 快捷键大全.pdf</a> ![](https://itsoku.oss-cn-hangzhou.aliyuncs.com/itsoku/blog/article/1/2883e86e-3eff-404a-8943-0066e5e2b454.png)
相关专辑:
RabbitMQ专题