当前位置: 首页 > article >正文

RibbitMQ-安装

本文主要介绍RibbitMQ的安装

RabbitMQ依赖于Erlang,因此首先需要安装Erlang环境。分别下载erlang-26.2.5-1.el7.x86_64.rpmrabbitmq-server-4.0.3-1.el8.noarch.rpm

官网地址:https://www.rabbitmq.com/

官网文档:https://www.rabbitmq.com/docs/which-erlang

源码地址:https://github.com/rabbitmq/rabbitmq-server

下载地址:https://github.com/rabbitmq/rabbitmq-server

image-20241101230144675

image-20241101230743726

Erlang地址:https://github.com/rabbitmq/erlang-rpm

Erlang下载:https://github.com/rabbitmq/erlang-rpm/releases

image-20241101230000714

安装erlang环境

# 查看系统环境
cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
cd /soft
# 安装erlang
rpm -ivh erlang-26.2.5-1.el7.x86_64.rpm
# 查看是否安装成功
erl -version
Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 14.2.5

安装RibbitMQ

cd /soft
# 安装ribbitmq
rpm -ivh rabbitmq-server-4.0.3-1.el8.noarch.rpm
# 编辑配置文件 (末尾的点不能少)
vim /etc/rabbitmq/rabbitmq.config
[
  {rabbit, [{tcp_listeners, [{"172.17.123.108", 5672}]}]},
  {rabbitmq_management, [
  {listener, [{port,15672}, {ssl, false}]}
  ]}
].
# 启动rabbitmq
systemctl start rabbitmq-server
# 查看rabbitmq状态
systemctl status rabbitmq-server
# 暂停rabbitmq
systemctl stop rabbitmq-server
# 设置rabbitmq服务开机自启动
systemctl enable rabbitmq-server
# 关闭rabbitmq服务
systemctl stop rabbitmq-server
# 重启rabbitmq服务
systemctl restart rabbitmq-server




Status of node rabbit@iZ2zee1rd1atxz543lbnbcZ ...
Runtime

OS PID: 7056
OS: Linux
Uptime (seconds): 15
Is under maintenance?: false
RabbitMQ version: 4.0.3
RabbitMQ release series support status: see https://www.rabbitmq.com/release-information
Node name: rabbit@iZ2zee1rd1atxz543lbnbcZ
Erlang configuration: Erlang/OTP 26 [erts-14.2.5] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1]
Crypto library: OpenSSL 1.1.1k  25 Mar 2021
Erlang processes: 302 used, 1048576 limit
Scheduler run queue: 1
Cluster heartbeat timeout (net_ticktime): 60

Plugins

Enabled plugin file: /etc/rabbitmq/enabled_plugins
Enabled plugins:


Data directory

Node data directory: /var/lib/rabbitmq/mnesia/rabbit@iZ2zee1rd1atxz543lbnbcZ
Raft data directory: /var/lib/rabbitmq/mnesia/rabbit@iZ2zee1rd1atxz543lbnbcZ/quorum/rabbit@iZ2zee1rd1atxz543lbnbcZ

Config files


# 启动ribbitweb管理界面
rabbitmq-plugins enable rabbitmq_management

查看ribbitmq的信息

# 查看当前进程状态
rabbitmq-diagnostics status

Status of node rabbit@iZ2zee1rd1atxz543lbnbcZ ...
Runtime

OS PID: 8618
OS: Linux
Uptime (seconds): 722
Is under maintenance?: false
RabbitMQ version: 4.0.3
RabbitMQ release series support status: see https://www.rabbitmq.com/release-information
Node name: rabbit@iZ2zee1rd1atxz543lbnbcZ
Erlang configuration: Erlang/OTP 26 [erts-14.2.5] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1]
Crypto library: OpenSSL 1.1.1k  25 Mar 2021
Erlang processes: 397 used, 1048576 limit
Scheduler run queue: 1
Cluster heartbeat timeout (net_ticktime): 60

Plugins

Enabled plugin file: /etc/rabbitmq/enabled_plugins
Enabled plugins:

 * rabbitmq_management
 * rabbitmq_management_agent
 * rabbitmq_web_dispatch
 * amqp_client
 * cowboy
 * cowlib
 * oauth2_client
 * jose

Data directory

Node data directory: /var/lib/rabbitmq/mnesia/rabbit@iZ2zee1rd1atxz543lbnbcZ
Raft data directory: /var/lib/rabbitmq/mnesia/rabbit@iZ2zee1rd1atxz543lbnbcZ/quorum/rabbit@iZ2zee1rd1atxz543lbnbcZ

Config files

 * /etc/rabbitmq/rabbitmq.config

Log file(s)

 * /var/log/rabbitmq/rabbit@iZ2zee1rd1atxz543lbnbcZ.log
 * <stdout>

Alarms

(none)

Memory

Total memory used: 0.0708 gb
Calculation strategy: rss
Memory high watermark setting: 0.6 of available memory, computed to: 9.6659 gb

code: 0.0208 gb (26.1 %)
allocated_unused: 0.0196 gb (24.62 %)
other_system: 0.0168 gb (21.18 %)
other_proc: 0.0156 gb (19.64 %)
other_ets: 0.0025 gb (3.15 %)
atom: 0.0011 gb (1.37 %)
plugins: 0.0011 gb (1.37 %)
metrics: 0.0008 gb (1.06 %)
binary: 0.0005 gb (0.63 %)
mgmt_db: 0.0003 gb (0.43 %)
msg_index: 0.0002 gb (0.2 %)
mnesia: 0.0001 gb (0.09 %)
metadata_store: 0.0 gb (0.06 %)
connection_other: 0.0 gb (0.04 %)
quorum_ets: 0.0 gb (0.03 %)
metadata_store_ets: 0.0 gb (0.01 %)
quorum_queue_procs: 0.0 gb (0.0 %)
quorum_queue_dlx_procs: 0.0 gb (0.0 %)
stream_queue_procs: 0.0 gb (0.0 %)
stream_queue_replica_reader_procs: 0.0 gb (0.0 %)
connection_readers: 0.0 gb (0.0 %)
connection_writers: 0.0 gb (0.0 %)
connection_channels: 0.0 gb (0.0 %)
queue_procs: 0.0 gb (0.0 %)
stream_queue_coordinator_procs: 0.0 gb (0.0 %)
reserved_unallocated: 0.0 gb (0.0 %)

File Descriptors

Total: 0, limit: 32671

Free Disk Space

Low free disk space watermark: 0.05 gb
Free disk space: 62.298 gb

Totals

Connection count: 0
Queue count: 0
Virtual host count: 1

Listeners

Interface: [::], port: 15672, protocol: http, purpose: HTTP API
Interface: [::], port: 25672, protocol: clustering, purpose: inter-node and CLI tool communication
Interface: 172.17.123.108, port: 5672, protocol: amqp, purpose: AMQP 0-9-1 and AMQP 1.0


# 配置文件地址
/etc/rabbitmq/rabbitmq.config
# 数据文件地址
/var/lib/rabbitmq/mnesia/rabbit@iZ2zee1rd1atxz543lbnbcZ
# 日志文件地址
/var/log/rabbitmq/rabbit@iZ2zee1rd1atxz543lbnbcZ.log

创建一个新的用户

# 创建用户
rabbitmqctl add_user xiaoyuan xiaoyuan 
# 设置权限
rabbitmqctl set_permissions -p / xiaoyuan ".*" ".*" ".*"
# 设置为管理员
rabbitmqctl set_user_tags xiaoyuan administrator

访问RibbitMQ的WEB界面 ‘http://8.140.224.210:15672/’ 账号&密码 guest/guest

image-20241101235053835

使用新建管理员账号 xiaoyuan/xiaoyuan

image-20241101235143442


http://www.kler.cn/a/384215.html

相关文章:

  • 分离编译(介绍,解决“类模板定义和声明不在同一文件导致链接错误“的问题),类模板实例化原理,
  • 汽修行业员工培训SOP的智能化搭建
  • 数据采集之selenium模拟登录
  • 职场逆袭!学会管理上司,你也能成为职场赢家
  • 数据管理的四大支柱:揭秘数据中台、数据仓库、数据治理和主数据
  • React中类组件和函数组件的理解和区别
  • K8S网络插件故障处理
  • 【STM32】DMA直接存储器读取
  • linux crash使用和环境部署
  • C++从零到满绩——命名空间、输入输出and缺省参数
  • Selenium 高频面试题及答案
  • Java中的远程方法调用——RPC详解
  • solo博客源码使用idea编译运行
  • 信息安全工程师(81)网络安全测评质量管理与标准
  • 关于vue3-router的基础知识点以及注意事项
  • C++ lambda 匿名函数
  • Foundry 单元测试
  • 15分钟学 Go 第 37 天:综合复习与小项目
  • Flutter鸿蒙next 的 Sliver 实现自定义滚动效果
  • .Net WeekOfYear 获取日期所属于一年中的第几周
  • Docker是什么
  • tinymce扩展功能:1、行高、段落间距、格式刷;2、视频上传进度条;3、对复制的图片设置尺寸
  • 【Axure高保真原型】2级下钻条形图
  • 沈阳乐晟睿浩科技有限公司抖音小店强者之路
  • 跨境云专线:构建高速、安全的全球业务网络
  • k8s之Kruise Rollouts灰度发布