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如何隐藏、变透明?
|
11月前
|
机器学习/深度学习 人工智能 前端开发
终端里的 AI 编程助手:OpenCode 使用指南
OpenCode 是开源的终端 AI 编码助手,支持 Claude、GPT-4 等模型,可在命令行完成代码编写、Bug 修复、项目重构。提供原生终端界面和上下文感知能力,适合全栈开发者和终端用户使用。
61082 11
|
人工智能 自然语言处理 搜索推荐
gemini国内能用吗?请收下这份gemini使用攻略!
在当今技术迅猛发展的时代,人工智能(AI)语言模型已经成为一股变革性的力量,推动着从自然语言处理到对话生成等广泛应用领域的创新。在众多杰出的AI语言模型中,Gemini以其卓越的性能和广泛的用途脱颖而出,备受推崇。作为谷歌旗下的多模态AI巨头,Gemini融合了最先进的语言处理技术,为用户提供了无与伦比的语言理解和生成能力。
|
存储 消息中间件 开发框架
如何开发一套ERP系统(附架构图+流程图+代码参考)
ERP系统是企业资源计划的核心工具,有效解决信息孤岛、数据重复等问题,提升管理效率与运营成本控制能力。本文详解ERP系统的核心模块及订单管理模块的开发流程,涵盖功能设计、技术选型与代码示例,助力企业高效搭建信息系统。
|
前端开发 Linux 网络安全
在Linux中,如何配置防火墙?
在Linux中,如何配置防火墙?
|
JavaScript Java 关系型数据库
流浪动物救助|基于Springboot的流浪动物救助平台设计与实现(源码+数据库+文档)
流浪动物救助|基于Springboot的流浪动物救助平台设计与实现(源码+数据库+文档)
1102 0
|
数据采集 消息中间件 API
Python爬虫验证码识别——手机验证码的自动化处理
Python爬虫验证码识别——手机验证码的自动化处理
2248 0
|
物联网 Python
Python 物联网入门指南(三)(2)
Python 物联网入门指南(三)
278 0
|
SQL 数据采集 监控
网站流量日志分析--统计分析--多维统计分析--了解其他维度分析|学习笔记
快速学习网站流量日志分析--统计分析--多维统计分析--了解其他维度分析
355 0
网站流量日志分析--统计分析--多维统计分析--了解其他维度分析|学习笔记

热门文章

最新文章