rabbitmq-server的安装与升级

Johnson木木 2021-04-08 09:51:37
安装 server rabbitMQ 升级 rabbitmq-server


下载地址

rabbitmq和erlang的对应版本:https://www.rabbitmq.com/which-erlang.html
rabbitmq-server包下载地址:https://github.com/rabbitmq/rabbitmq-server/releases
erlang包下载地址:https://github.com/rabbitmq/erlang-rpm/releases
socat包下载地址:https://pkgs.org/download/socat

安装

安装之前需要查看自己系统的版本

# uname -a
Linux admin.blog.test 3.10.0-1160.21.1.el7.x86_64 #1 SMP Tue Mar 16 18:28:22 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

可以看到我的系统是el7.x86_64版本的。下载rabbitmq-server、erlang、socat都需要和系统版本对应
安装rabbitmq-server前必须安装erlang和socat,因为rabbitmq-server需要依赖这两个。

安装socat

安装socat只需要装最新的就ok了

wget http://mirror.centos.org/centos/7/os/x86_64/Packages/socat-1.7.3.2-2.el7.x86_64.rpm
rpm -ivh socat-1.7.3.2-2.el7.x86_64.rpm

-i 代表install, -v 和 -h 只不过是打印操作日志的一些参数设置

我的系统是el7.x86_64版本的,所以下载该版本
image.png

安装erlang

首先去查看rabbitmq-server版本对应的erlang版本,erlang下载地址:https://www.rabbitmq.com/which-erlang.html

image.png

那么就去下载erlang的23.x最新版本吧。

wget https://github.com/rabbitmq/erlang-rpm/releases/download/v23.3.1/erlang-23.3.1-1.el7.x86_64.rpm
rpm -ivh erlang-23.3.1-1.el7.x86_64.rpm

安装rabbitmq-server

安装完erlang和socat后,才可以安装rabbitmq-server,下载地址:https://github.com/rabbitmq/rabbitmq-server/releases
找到系统对应的rabbitmq-server版本和密钥进行下载:
image.png

首先导入密钥

rpm -import https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.14/rabbitmq-server-3.8.14-1.el7.noarch.rpm.asc

下载并安装rabbitmq-server

wget https://github.com/rabbitmq/rabbitmq-server/releases/download/v3.8.14/rabbitmq-server-3.8.14-1.el7.noarch.rpm
rpm -ivh rabbitmq-server-3.8.14-1.el7.noarch.rpm

此时就应该就安装好rabbitmq-server了。

启动和停止rabbitmq服务

启动rabbitmq服务

nohup /usr/lib/rabbitmq/bin/rabbitmq-server start > rabbitmq.log &

停止rabbitmq服务

/usr/lib/rabbitmq/bin/rabbitmqctl stop

升级rabbitmq服务

如果是rabbitmq-server的版本升级跨越稍微比较大,那么erlang版本就可能也需要升级。
此时我把rabbitmq-server降级为3.7.16,erlang版本为21

/usr/lib/rabbitmq/bin/rabbitmqctl version
3.7.16
erl version
Erlang/OTP 21 [erts-10.3.5.10] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe]

现在要升级rabbitmq-server为3.8.14版本。升级rabbitmq-sever服务前,先停止rabbitmq服务和升级erlang版本。
需要注意的是,升级服务的命令参数为 -Uupgrade,如果是安装服务的命令参数才是 -iinstall

/usr/lib/rabbitmq/bin/rabbitmqctl stop
# 升级erlang版本
rpm -Uvh erlang-23.3.1-1.el7.x86_64.rpm
rpm -Uvh rabbitmq-server-3.8.14-1.el7.noarch.rpm

那么此时则升级rabbitmq完毕。

rabbitmq管理控制台

启动控制台需要启用rabbitmq_management插件

/usr/lib/rabbitmq/bin/rabbitmq-plugins enable rabbitmq_management

将RabbitMQ文件的所有权提供给RabbitMQ用户

chown -R rabbitmq:rabbitmq /var/lib/rabbitmq/

给rabbitmq管理控制台添加管理员用户

rabbitmqctl add_user admin adminPassword
rabbitmqctl set_user_tags admin administrator
rabbitmqctl set_permissions -p / admin ".*" ".*" ".*"

操作完后打开地址http://你的服务IP:15672, 登录后可以查看到这样的界面

image.png

总结

以上就是关于rabbitmq服务安装与升级的一些基本操作。

个人博客网址: https://colablog.cn/

如果我的文章帮助到您,可以关注我的微信公众号,第一时间分享文章给您
微信公众号

版权声明
本文为[Johnson木木]所创,转载请带上原文链接,感谢
https://www.cnblogs.com/Johnson-lin/p/14624520.html

  1. How to realize encryption and decryption of spring boot interface parameters gracefully?
  2. A new way to play in spring 5! This kind of URL request makes me see better!
  3. Can parameters in spring MVC be passed like this? It's up!
  4. Hand in hand to teach you how to develop mybatis plug-ins
  5. Fine spring boot + thymeleaf, there are so many fun details!
  6. Spring boot logs all kinds of posture, it's time to clear!
  7. Web 3.0踏浪而来,分布式存储举足轻重|时空云邀请您参加Web3.0中国峰会暨分布式存储行业大会
  8. spring-aop 进不了切面方法的解决办法
  9. Web 3.0 is coming, distributed storage is very important | spatiotemporal cloud invites you to attend Web3.0 China Summit and distributed storage industry conference
  10. The solution of spring AOP can't enter the section method
  11. Linux中如何启用root用户
  12. How to enable root in Linux
  13. 踩坑 MySQL 索引,看看你真的会用吗?
  14. Hive优化之配置参数的优化(一)
  15. Step on the MySQL index to see if you really know how to use it?
  16. Optimization of configuration parameters for hive optimization (1)
  17. Linux入门教程资料分享
  18. Introduction to Linux
  19. 外部连接mysql docker容器异常
  20. Exception of external connection MySQL docker container
  21. Zookeeper分布式锁?
  22. Zookeeper distributed lock?
  23. 嵌入式Linux_Framebuffer_03点阵显示ASCII字符串
  24. 嵌入式Linux_Framebuffer_02字符编码
  25. Embedded Linux_ Framebuffer_ 03 dot matrix display ascii string
  26. Embedded Linux_ Framebuffer_ 02 character encoding
  27. Looking forward to new product launch of Xiaomi in spring CNMO takes you to see 11 new products in advance
  28. An inventory of the commonly used garbage collectors in Java
  29. Why is it so easy to get started with HBase?
  30. Implementation of PRC framework based on netty
  31. 2021 Java back end engineer must know knowledge - (Dubbo, distributed RPC framework)
  32. 关于spring advisor和元数据 同时来管理事务的问题
  33. How to manage transactions with spring advisor and metadata at the same time
  34. 使用Playwright对Java API实现自动视觉测试 - applitools
  35. Using playwright to implement automatic visual testing for Java API - applitools
  36. Dubbo和Spring cloud、Istio对比图
  37. Comparison of Dubbo with spring cloud and istio
  38. HttpServletRequest、通过request获得请求头、请求体等、解决中文乱码等问题
  39. Mybatis学习笔记-一对一,一对多,多对多关联查询
  40. Mybatis学习笔记-基本概念与操作
  41. HttpServletRequest, obtaining request header and request body through request, solving Chinese garbled code and other problems
  42. Mybatis learning notes - one to one, one to many, many to many association query
  43. Mybatis learning notes - basic concepts and operation
  44. Spring Cloud 升级之路 - 2020.0.x - 3. Undertow 的 accesslog 配置
  45. Spring cloud upgrade road - 2020.0. X - 3. Accesslog configuration of undertow
  46. 被Java培训机构坑骗后,我在这里找回了自信
  47. After being cheated by java training institutions, I found my confidence here
  48. Linux下安装Mysql出现的常见问题以及解决办法
  49. Common problems and solutions of installing MySQL under Linux
  50. java并发编程JUC第十二篇:AtomicInteger原子整型
  51. Java Concurrent Programming JUC Chapter 12: atomicinteger atomic integer
  52. 面经手册 · 第29篇《Spring IOC 特性有哪些,不会读不懂源码!》
  53. Chapter 29 "what are the features of spring IOC? I can't understand the source code! 》
  54. 浅析linux容器--Docker
  55. Analysis of Linux container -- docker
  56. 换种方法学操作系统,轻松入门Linux内核
  57. 浅析linux容器--Docker
  58. Another way to learn operating system, easy access to Linux kernel
  59. Analysis of Linux container -- docker
  60. 手摸手教你阅读和调试大型开源项目 ZooKeeper