安装和配置RabbitMQ


一、安装环境

名称 版本
虚拟机软件 VMWare 12
操作系统 CentOS Linux release 7.7.1908
Erlang erlang-23.0.2-1.el7.x86_64
RabbitMQ rabbitmq-server-3.8.4-1.el7.noarch

说明
RabbitMQ的安装需要首先安装Erlang,因为它是基于Erlang的VM运行的。
RabbitMQ需要的依赖:socat和logrotate,logrotate操作系统中已经存在了,只需要安装socat就可以了。

注意
RabbitMQ与Erlang的兼容关系详见:https://www.rabbitmq.com/which-erlang.html

二、环境搭建

1、安装依赖

 yum install socat -y

2、安装Erlang

 erlang-23.0.2-1.el7.x86_64.rpm下载地址:https://github.com/rabbitmq/erlang-rpm/releases/download/v23.0.2/erlang-23.0.2-1.el7.x86_64.rpm首先将erlang-23.0.2-1.el7.x86_64.rpm上传至服务器,然后执行下述命令:
 rpm -ivh erlang-23.0.2-1.el7.x86_64.rpm

3、安装RabbitMQ

 rabbitmq-server-3.8.4-1.el7.noarch.rpm下载地址:https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.5/rabbitmq-server-3.8.5-1.el7.noarch.rpm首先将rabbitmq-server-3.8.4-1.el7.noarch.rpm上传至服务器,然后执行下述命令:
 rpm -ivh rabbitmq-server-3.8.4-1.el7.noarch.rpm

4、启用RabbitMQ的管理插件

 rabbitmq-plugins enable rabbitmq_management

查看插件状态

帮助命令:查看相关命令和参数

[root@RabbitMQ ~]# rabbitmqctl help
Error:Usagerabbitmqctl [--node <node>] [--timeout <timeout>] [--longnames] [--quiet] <command> [<command options>]Available commands:Help:help                          Displays usage information for a commandversion                       Displays CLI tools versionNodes:await_startup                 Waits for the RabbitMQ application to start on the target nodereset                         Instructs a RabbitMQ node to leave the cluster and return to its virgin staterotate_logs                   Instructs the RabbitMQ node to perform internal log rotationshutdown                      Stops RabbitMQ and its runtime (Erlang VM). Monitors progress for local nodes. Does not require a PID file path.start_app                     Starts the RabbitMQ application but leaves the runtime (Erlang VM) runningstop                          Stops RabbitMQ and its runtime (Erlang VM). Requires a local node pid file path to monitor progress.stop_app                      Stops the RabbitMQ application, leaving the runtime (Erlang VM) runningwait                          Waits for RabbitMQ node startup by monitoring a local PID file. See also 'rabbitmqctl await_online_nodes'Cluster:await_online_nodes            Waits for <count> nodes to join the clusterchange_cluster_node_type      Changes the type of the cluster nodecluster_status                Displays all the nodes in the cluster grouped by node type, together with the currently running nodesforce_boot                    Forces node to start even if it cannot contact or rejoin any of its previously known peersforce_reset                   Forcefully returns a RabbitMQ node to its virgin stateforget_cluster_node           Removes a node from the clusterjoin_cluster                  Instructs the node to become a member of the cluster that the specified node is inrename_cluster_node           Renames cluster nodes in the local databaseupdate_cluster_nodes          Instructs a cluster member node to sync the list of known cluster members from <seed_node>Replication:cancel_sync_queue             Instructs a synchronising mirrored queue to stop synchronising itselfsync_queue                    Instructs a mirrored queue with unsynchronised mirrors (follower replicas) to synchronise themUsers:add_user                      Creates a new user in the internal databaseauthenticate_user             Attempts to authenticate a user. Exits with a non-zero code if authentication fails.change_password               Changes the user passwordclear_password                Clears (resets) password and disables password login for a userdelete_user                   Removes a user from the internal database. Has no effect on users provided by external backends such as LDAPlist_users                    List user names and tagsset_user_tags                 Sets user tagsAccess Control:clear_permissions             Revokes user permissions for a vhostclear_topic_permissions       Clears user topic permissions for a vhost or exchangelist_permissions              Lists user permissions in a virtual hostlist_topic_permissions        Lists topic permissions in a virtual hostlist_user_permissions         Lists permissions of a user across all virtual hostslist_user_topic_permissions   Lists user topic permissionslist_vhosts                   Lists virtual hostsset_permissions               Sets user permissions for a vhostset_topic_permissions         Sets user topic permissions for an exchangeMonitoring, observability and health checks:environment                   Displays the name and value of each variable in the application environment for each running applicationlist_bindings                 Lists all bindings on a vhostlist_channels                 Lists all channels in the nodelist_ciphers                  Lists cipher suites supported by encoding commandslist_connections              Lists AMQP 0.9.1 connections for the nodelist_consumers                Lists all consumers for a vhostlist_exchanges                Lists exchangeslist_hashes                   Lists hash functions supported by encoding commandslist_queues                   Lists queues and their propertieslist_unresponsive_queues      Tests queues to respond within timeout. Lists those which did not respondping                          Checks that the node OS process is up, registered with EPMD and CLI tools can authenticate with itreport                        Generate a server status report containing a concatenation of all server status information for support purposesschema_info                   Lists schema database tables and their propertiesstatus                        Displays status of a nodeParameters:clear_global_parameter        Clears a global runtime parameterclear_parameter               Clears a runtime parameter.list_global_parameters        Lists global runtime parameterslist_parameters               Lists runtime parameters for a virtual hostset_global_parameter          Sets a runtime parameter.set_parameter                 Sets a runtime parameter.Policies:clear_operator_policy         Clears an operator policyclear_policy                  Clears (removes) a policylist_operator_policies        Lists operator policy overrides for a virtual hostlist_policies                 Lists all policies in a virtual hostset_operator_policy           Sets an operator policy that overrides a subset of arguments in user policiesset_policy                    Sets or updates a policyVirtual hosts:add_vhost                     Creates a virtual hostclear_vhost_limits            Clears virtual host limitsdelete_vhost                  Deletes a virtual hostlist_vhost_limits             Displays configured virtual host limitsrestart_vhost                 Restarts a failed vhost data stores and queuesset_vhost_limits              Sets virtual host limitstrace_off                     trace_on                      Node configuration:decode                        Decrypts an encrypted configuration valueencode                        Encrypts a sensitive configuration valueset_cluster_name              Sets the cluster nameset_disk_free_limit           Sets the disk_free_limit settingset_log_level                 Sets log level in the running nodeset_vm_memory_high_watermark  Sets the vm_memory_high_watermark settingDefinitions:export_definitions            Exports definitions in JSON or compressed Erlang Term Format.import_definitions            Imports definitions in JSON or compressed Erlang Term Format.Deprecated:node_health_check             DEPRECATED. Performs intrusive, opinionated health checks on a fully booted node. See https://www.rabbitmq.com/monitoring.html#health-checks insteadFeature flags:enable_feature_flag           Enables a feature flag on target nodelist_feature_flags            Lists feature flagsOperations:close_all_connections         Instructs the broker to close all connections for the specified vhost or entire RabbitMQ nodeclose_connection              Instructs the broker to close the connection associated with the Erlang process ideval                          Evaluates a snippet of Erlang code on the target nodeexec                          Evaluates a snippet of Elixir code on the CLI nodeforce_gc                      Makes all Erlang processes on the target node perform/schedule a full sweep garbage collectionhipe_compile                  Only exists for backwards compatibility. HiPE support has been dropped starting with Erlang 22. Do not useQueues:delete_queue                  Deletes a queuepurge_queue                   Purges a queue (removes all messages in it)Use 'rabbitmqctl help <command>' to learn more about a specific command

5、开启RabbitMQ

 方式一:systemctl start rabbitmq-server 方式二:rabbitmq-server 方式三:rabbitmq-server -detached   (后台启动)


查看插件(此用户只能在本机使用)

6、添加用户

 rabbitmqctl add_user root 123456

7、给用户设置标签

 用户的标签和权限:
 rabbitmqctl set_user_tags root administrator

使用刚才创建的用户登录/使用新账号登陆,无权访问虚拟主机

用户的标签和权限

Tag Capabilities
(None) 没有访问management插件的权限
management 可以使用消息协议做任何操作的权限,加上:1. 可以使用AMQP协议登录的虚拟主机的权限 2. 查看它们能登录的所有虚拟主机中所有队列、交换器和绑定的权限 3. 查看和关闭它们自己的通道和连接的权限 4. 查看它们能访问的虚拟主机中的全局统计信息,包括其他用户的活动
policymaker 所有management标签可以做的,加上:1. 在它们能通过AMQP协议登录的虚拟主机上,查看、创建和删除策略以及虚拟主机参数的权限
monitoring 所有management能做的,加上:1. 列出所有的虚拟主机,包括列出不能使用消息协议访问的虚拟主机的权限2. 查看其他用户连接和通道的权限3. 查看节点级别的数据如内存使用和集群的权限4. 查看真正的全局所有虚拟主机统计数据的权限
administrator 所有policymaker和monitoring能做的,加上:1. 创建删除虚拟主机的权限2. 查看、创建和删除用户的权限3. 查看、创建和删除权限的权限4. 关闭其他用户连接的权限

8、给用户添加权限

 给root用户在虚拟主机"/"上的配置、写、读的权限
 rabbitmqctl set_permissions root -p / ".*" ".*" ".*"

9、打开浏览器,使用刚才创建的用户登录访问http://<安装了CentOS的VMWare虚拟机IP地址>:15672

问题1:useradd: cannot open /etc/passwd

解决:

 useradd: cannot open /etc/passwduseradd: cannot open /etc/passwdchattr -a /etc/shadowchattr -a /etc/group

问题2:reply-text=NOT_ALLOWED - access to vhost ‘/’ refused for user ‘root’

解决:rabbitmqctl set_permissions -p / root ‘.’ '.’ ‘.*’

RabbitMQ3.8.4安装和配置相关推荐

  1. Maven安装与配置(最实用!!!)eclipse中配置maven

    Maven安装与配置 一.需要准备的东西 JDK Eclipse(本章主要是在eclipse中进行配置maven) Maven程序包 二.下载与安装 1. 前往maven下载最新版的Maven程序: ...

  2. Portainer 安装与配置

    文章目录 Portainer 安装与配置 一.介绍 二.安装使用 1.单机运行 2.基于swarm集群方式运行 Portainer 安装与配置 一.介绍 ​ Portainer 是一个开源.轻量级Do ...

  3. Myeclipse安装、配置、测试

    Myeclipse安装.配置.测试(win7_64bit) 目录 1.概述 2.本文用到的工具 3.安装与激活 4.JavaSE开发测试(确保JDK已正确安装) 5.JavaEE开发测试(确保服务器和 ...

  4. [网摘学习]在Ubuntu上安装和配置OpenStack Nova之二

    再收藏一份Openstack的文章,这两天的操作与此相同.但其中出现的问题还需要查找原因.待个人继续学习研究. 原文参考:http://www.linuxde.net/2011/11/1599.htm ...

  5. centos6.5 php5.2,Linux中PHP安装与配置(CentOS-6.5:php-5.2.13)

    1 PHP简介     PHP(PHP: Hypertext Preprocessor的缩写,中文名:"超文本预处理器")是一种通用开源脚本语言.语法吸收了C语言.Java和Per ...

  6. java jdk 1.8 安装_下载、安装、配置 java jdk1.8

    近期配置react native的开发环境,所以就从配置环境开始.rn的环境配置有那么几项,其中重要的一个就是java jdk(Java Development Kit 的缩写),那么以下就是下载.安 ...

  7. mysql安装好需要优化配置一下_Mysql的安装、配置、优化

    Mysql的安装.配置.优化 安装步骤 1.先单击中的安装文件,如果是win7系统,请选择以管理员的方式运行. 2.大概需要30秒的时间,开始进入安装界面.请先把标红的打勾,好进行下一步的动作. 3. ...

  8. windows下opencv安装及配置(vs2010环境)

    opecv下载 前往官方下载地址 https://opencv.org/releases/ opencv安装及配置 解压,会得到一个opencv文件夹,可将提取出的文件移动到任意位置,我将其放在F盘. ...

  9. Elasticsearch 6.3.1、Head插件 安装及配置

    安装Elasticsearch Elasticsearch下载地址:https://www.elastic.co/cn/downloads/elasticsearch 也可以直接使用wget下载到某目 ...

最新文章

  1. linux磁盘管理相关命令,Linux | 磁盘管理命令
  2. 6 种激活函数核心知识点,请务必掌握!
  3. 【SpringMVC】登录状态验证
  4. 计算机资产管理,▪ 资产管理
  5. 行政管理对计算机的要求,信息技术对行政管理的影响.doc
  6. Spring MVC Formatter(数据格式化)详解
  7. CSS text-decoration 属性
  8. laravel application 容器app
  9. ubuntu中wps缺失字体
  10. 通过tomcat配置solr 4.10.3
  11. 萤火虫算法matlab实现,智能算法萤火虫算法Matlab源代码
  12. Oracle常用函数之数值函数
  13. c语言有向网络介数,SNA社交网络算法
  14. Android 打包AAB+PAD(Unity篇)
  15. 完整最新的f1比赛规则
  16. $body.on(‘click‘,‘button‘,function() {中.on在这里是什么意思的
  17. 生物特征识别技术领跑者--墨奇科技 全面亮相2022身份识别技术大会
  18. 20200903-03-Hadoop运行模式之本地运行模式伪分布式运行模式
  19. 计算机学的痛苦可以换专业,在大学里选错了专业,是一种怎样的“痛苦”体验?...
  20. 水表读数图解_水表读数怎么正确看 水表怎么读?

热门文章

  1. jQuery 源码系列(四)Tokens 词法分析
  2. LINQ to XML 编程基础
  3. 开源云操作系统:填补技术空白 加速商业化进程
  4. 前端开发如何做好本地接口模拟
  5. “产学合作勇创新·协同育人书新篇”贵州理工大数据学院数据科学训练营结题答辩报告会圆满举行...
  6. vue1和vue2获取dom元素的方法 及 nextTick() 、$nextTick()
  7. 《iOS 9 开发指南》——第6章,第6.7节iOS 9控件的属性
  8. 使用Unity制作的一个望远镜特效,在狙击手游戏中非经常见
  9. 海量数据(数据量比较大时)的处理分析
  10. OpenSSL在Windows下使用vs2010的编译安装