目录
一、安装及图形化界面
概述
- 简单概述RabbitMQ是一个开源的遵循AMQP协议实现的基于Erlang语言编写,支持多种客户端(语言)。
- 用于在分布式系统中存储、转发消息,具有高可用、高拓展性、易用等特征
1.安装
windows下载安装 参考:https://www.jianshu.com/p/a2c9a4242508
- 安装之后发现执行
rabbitmq-plugins enable rabbitmq_management 安装插件发现没反应,打开rabbitmq-server.bat报错,可能是电脑中文用户名的的问题,具体参考:Windows环境下RabbitMQ安装报错完美解决方法 - 修改默认文件存储位置:还报错的情况下需要注意的是使用 RabbitMQ Command Prompt (sbin dir) 命令行执行
rabbitmq-server.bat 不要直接点击bat文件,因为bat默认文件路径还没修改,需要修改rabbitmq-env.bat文件,设置默认的数据文件路径 ,具体设置还是参考上面解决方法
Linux下载安装参考:https://www.linuxidc.com/Linux/2020-01/161901.htm
2.图形化界面
说明
- 默认情况下,没有安装web端的客户端插件,安装执行
rabbitmq-plugins enable rabbitmq_management - 安装之后重新打开rabbitmq-server.bat即可
- 默认guest默认账号只能本地访问,远程访问需要再添加个账户,而且远程服务器的安全组策略放行
15672 端口 - 测试访问http://localhost:15672,出现登录页面即为成功
授权账号和密码
- 新增用户
rabbitmqctl add_user admin admin - 设置用户分配权限操作
rabbitmqctl set_user_tags admin administrator ,角色分类
administrator 超级管理员 可以登陆控制台、查看所有信息、对rabbitmq管理monitoring 监控者 登录控制台、查看所有信息policymarker 策略制定者 登录控制台、指定策略managment 普通管理员 登录控制台
更多操作
举栗
E:\Program Files\RabbitMQ Server\rabbitmq_server-3.8.11\sbin>rabbitmqctl add_user admin admin
Adding user "admin" ...
Done. Don't forget to grant the user permissions to some virtual hosts! See 'rabbitmqctl help set_permissions' to learn more.
E:\Program Files\RabbitMQ Server\rabbitmq_server-3.8.11\sbin>rabbitmqctl set_user_tags admin administrator
Setting tags for user "admin" to [administrator] ...
E:\Program Files\RabbitMQ Server\rabbitmq_server-3.8.11\sbin>
二、Docker安装RabbitMQ
举栗
[root@iZ2vc8owmlobwkazif1efpZ ~]
Docker version 1.13.1, build 4ef4b30/1.13.1
[root@iZ2vc8owmlobwkazif1efpZ ~]
[root@iZ2vc8owmlobwkazif1efpZ ~]
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: active (running) since Sat 2021-04-03 20:12:30 CST; 3 months 11 days ago
Docs: http://docs.docker.com
Main PID: 4443 (dockerd-current)
CGroup: /system.slice/docker.service
├─4443 /usr/bin/dockerd-current --add-runtime docker-runc=/usr/libexec/docker/docker...
└─4453 /usr/bin/docker-containerd-current -l unix:///var/run/docker/libcontainerd/do...
Apr 29 19:49:16 iZ2vc8owmlobwkazif1efpZ dockerd-current[4443]: /docker-entrypoint.sh: Launchin...h
Apr 29 19:49:16 iZ2vc8owmlobwkazif1efpZ dockerd-current[4443]: /docker-entrypoint.sh: Launchin...h
Apr 29 19:49:16 iZ2vc8owmlobwkazif1efpZ dockerd-current[4443]: /docker-entrypoint.sh: Configur...p
Apr 29 19:49:16 iZ2vc8owmlobwkazif1efpZ dockerd-current[4443]: 2021/04/29 11:49:16 [emerg] 1
Apr 29 19:49:16 iZ2vc8owmlobwkazif1efpZ dockerd-current[4443]: nginx: [emerg] "upstream" direc...3
Apr 29 19:49:16 iZ2vc8owmlobwkazif1efpZ dockerd-current[4443]: time="2021-04-29T19:49:16.11270..."
Apr 29 19:49:16 iZ2vc8owmlobwkazif1efpZ dockerd-current[4443]: time="2021-04-29T19:49:16.16372..."
Apr 29 19:49:33 iZ2vc8owmlobwkazif1efpZ dockerd-current[4443]: time="2021-04-29T19:49:33.571587...
Apr 29 19:49:40 iZ2vc8owmlobwkazif1efpZ dockerd-current[4443]: time="2021-04-29T19:49:40.75357..."
Apr 29 19:49:57 iZ2vc8owmlobwkazif1efpZ dockerd-current[4443]: time="2021-04-29T19:49:57.201421...
Hint: Some lines were ellipsized, use -l to show in full.
[root@iZ2vc8owmlobwkazif1efpZ ~]
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/mongo latest 995ccc33e58f 2 months ago 449 MB
docker.io/nginx latest 519e12e2a84a 3 months ago 133 MB
docker.io/mysql 5.7 450379344707 3 months ago 449 MB
docker.io/portainer/portainer latest 580c0e4e98b0 3 months ago 79.1 MB
docker.io/hello-world latest d1165f221234 4 months ago 13.3 kB
docker.io/centos latest 300e315adb2f 7 months ago 209 MB
[root@iZ2vc8owmlobwkazif1efpZ ~]
Trying to pull repository docker.io/library/rabbitmq ...
3.7.7-management: Pulling from docker.io/library/rabbitmq
802b00ed6f79: Pull complete
84fe35f04ebe: Pull complete
72a118dc68c2: Pull complete
51c199718697: Pull complete
e74b797281ea: Pull complete
f2b0494f0e3c: Downloading [============================> ] 15.52 MB/27.5 MB
d43b5d7d2745: Download complete
dedfc544656e: Download complete
ed99f98ab240: Download complete
422ec57c0d17: Download complete
85c41b55ab02: Download complete
8d040d0f68fe: Download complete
881b91c66b89: Download complete
06bcf7b1b9c9: Download complete
========== 或者 =============
[root@iZ2vc8owmlobwkazif1efpZ ~]
Unable to find image 'rabbitmq:management' locally
Trying to pull repository docker.io/library/rabbitmq ...
management: Pulling from docker.io/library/rabbitmq
a31c7b29f4ad: Pull complete
0ea5da5fa011: Pull complete
2d9925bd5669: Downloading [=====================================> ] 38.29 MB/50.66 MB
56f5b6dce95d: Download complete
ae74659cb465: Downloading [======> ] 2.522 MB/18.08 MB
e20048198e4f: Download complete
9b824a4a94bf: Download complete
a708661d5d9a: Waiting
dba4fca7ba03: Waiting
/usr/bin/docker-current: error pulling image configuration: read tcp 172.25.204.157:59294->104.18.125.25:443: read: connection reset by peer.
See '/usr/bin/docker-current run --help'.
[root@iZ2vc8owmlobwkazif1efpZ ~]
三、角色分类
概念
- 5中基本角色,第一种基本不用无什么意义
- 可以在web控制端进行角色授予
web端账号角色授予
|