about ceph monitor's consistency

简介:
    ceph 的mon节点维护了整个ceph 存储集群的map状态.
    因为mon节点是多个的, 所以要求所有mon节点的map状态一致, mon使用paxos算法(分布式一致性算法)来修改map的状态, 确保所有mon节点的map数据一致.
    因此mon节点并不是通过集群配置文件如ceph.conf来保持map一致的, 而是map文件.
    每次map文件变更前, 需要多数monitor节点同意, 确保多数或所有(quorum)节点的map文件一致, 并且map文件是增量更新的, 每次更新产生一个新的version, 所以当mon节点离线再加入时, 需要同步增量部分的信息. 
    monitor相互之间是如何发现的呢? 
    同样是通过map文件, 而不是静态的集群配置文件如ceph.conf.
    我们来dump一个map文件的信息看看 ?
[root@mon5 ~]# ceph mon getmap -o /tmp/monmap
got monmap epoch 8

打印map文件内容
[root@mon5 ~]# monmaptool --print /tmp/monmap 
monmaptool: monmap file /tmp/monmap
epoch 8
fsid f649b128-963c-4802-ae17-5a76f36c4c76
last_changed 2014-12-10 11:52:43.961159
created 2014-12-09 15:24:33.339570
0: 172.17.0.2:6789/0 mon.mon1
1: 172.17.0.3:6789/0 mon.mon2
2: 172.17.0.4:6789/0 mon.mon3
3: 172.17.0.9:6789/0 mon.mon4
4: 172.17.0.10:6789/0 mon.mon5

所有mon节点的信息应该是一致的.

[参考]
1.  http://docs.ceph.com/docs/master/rados/operations/add-or-rm-mons/
Monitors are critical components of a Ceph cluster, and they need to maintain a quorum for the whole system to work properly. To establish a quorum, the monitors need to discover each other. Ceph has strict requirements for discovering monitors.

Ceph clients and other Ceph daemons use ceph.conf to discover monitors. However, monitors discover each other using the monitor map, not ceph.conf. For example, if you refer to Adding a Monitor (Manual) you will see that you need to obtain the current monmap for the cluster when creating a new monitor, as it is one of the required arguments of ceph-mon -i {mon-id} --mkfs. The following sections explain the consistency requirements for Ceph monitors, and a few safe ways to change a monitor’s IP address.

CONSISTENCY REQUIREMENTS

A monitor always refers to the local copy of the monmap when discovering other monitors in the cluster. Using the monmap instead of ceph.conf avoids errors that could break the cluster (e.g., typos in ceph.conf when specifying a monitor address or port). Since monitors use monmaps for discovery and they share monmaps with clients and other Ceph daemons, the monmap provides monitors with a strict guarantee that their consensus is valid.

Strict consistency also applies to updates to the monmap. As with any other updates on the monitor, changes to the monmap always run through a distributed consensus algorithm called Paxos. The monitors must agree on each update to the monmap, such as adding or removing a monitor, to ensure that each monitor in the quorum has the same version of the monmap. Updates to the monmap are incremental so that monitors have the latest agreed upon version, and a set of previous versions, allowing a monitor that has an older version of the monmap to catch up with the current state of the cluster.

If monitors discovered each other through the Ceph configuration file instead of through the monmap, it would introduce additional risks because the Ceph configuration files aren’t updated and distributed automatically. Monitors might inadvertently use an older ceph.conf file, fail to recognize a monitor, fall out of a quorum, or develop a situation where Paxos isn’t able to determine the current state of the system accurately. Consequently, making changes to an existing monitor’s IP address must be done with great care.

目录
相关文章
|
存储 运维 安全
华为的云计算认证和阿里云的云计算认证有什么区别?
作为一个新兴的行业,云计算在最近几年正逐渐提高自己在人们日常生活中的作用,给人们的生活带来了巨大的便利,而且随着科技地不断发展。
|
小程序
小程序页面顶部标题栏、导航栏navigationBar如何隐藏、变透明?
小程序页面顶部标题栏、导航栏navigationBar如何隐藏、变透明?
|
运维 大数据 Apache
|
人工智能 自然语言处理 搜索推荐
gemini国内能用吗?请收下这份gemini使用攻略!
在当今技术迅猛发展的时代,人工智能(AI)语言模型已经成为一股变革性的力量,推动着从自然语言处理到对话生成等广泛应用领域的创新。在众多杰出的AI语言模型中,Gemini以其卓越的性能和广泛的用途脱颖而出,备受推崇。作为谷歌旗下的多模态AI巨头,Gemini融合了最先进的语言处理技术,为用户提供了无与伦比的语言理解和生成能力。
|
人工智能 自然语言处理 小程序
VibeCoding On Function AI Deep Dive:用 AI 应用生产 AI 应用
本文介绍了如何通过自然语言构建AI应用,展示了使用VibeCoding技术实现儿童教育、娱乐及企业网站智能问答等场景的实战案例。无需编程,仅凭对话即可完成开发、发布,体现了AI时代软件开发的变革与创新。
|
存储 消息中间件 开发框架
如何开发一套ERP系统(附架构图+流程图+代码参考)
ERP系统是企业资源计划的核心工具,有效解决信息孤岛、数据重复等问题,提升管理效率与运营成本控制能力。本文详解ERP系统的核心模块及订单管理模块的开发流程,涵盖功能设计、技术选型与代码示例,助力企业高效搭建信息系统。
|
人工智能 缓存 安全
首发,Higress AI 网关率先支持 QwQ-32B,推理成本可再降 90%
QwQ-32B 是一款拥有 320 亿参数的大模型,性能媲美 6710 亿参数的 DeepSeek-R1。它支持本地运行、显著降低企业调用成本(最高降 90%),并在 Hugging Face 和 ModelScope 开源。本文提供通过 Higress AI 网关实现 DeepSeek-R1 和 QwQ-32B 无缝切换的教程,涵盖环境准备、模型接入配置及客户端调用示例。Higress AI 网关还具备消费者鉴权、模型自动切换、Token 级限流等进阶功能,助力企业高效管理多模型服务。
1288 1
|
前端开发 Linux 网络安全
在Linux中,如何配置防火墙?
在Linux中,如何配置防火墙?
|
域名解析 负载均衡 安全
DNS技术标准趋势和安全研究
本文探讨了互联网域名基础设施的结构性安全风险,由清华大学段教授团队多年研究总结。文章指出,DNS系统的安全性不仅受代码实现影响,更源于其设计、实现、运营及治理中的固有缺陷。主要风险包括协议设计缺陷(如明文传输)、生态演进隐患(如单点故障增加)和薄弱的信任关系(如威胁情报被操纵)。团队通过多项研究揭示了这些深层次问题,并呼吁构建更加可信的DNS基础设施,以保障全球互联网的安全稳定运行。
|
JavaScript Java 关系型数据库
流浪动物救助|基于Springboot的流浪动物救助平台设计与实现(源码+数据库+文档)
流浪动物救助|基于Springboot的流浪动物救助平台设计与实现(源码+数据库+文档)
1060 0

热门文章

最新文章