pacemaker架构分析
简要介绍
Pacemaker是 Linux环境中使用最为广泛的开源集群资源管理器。
pacemaker集群架构
一个pacemaker集群通常包括以下部分(Pacemaker stack)
-
Resources: These are the reason for the cluster’s being — the services that need to be kept highly available.
集群存在的目的就是为了管理Resources,比如虚拟ip服务,文件系统服务,数据库服务,都可以称之为资源
-
Resource agents: These are scripts or operating system components that start, stop, and monitor resources, given a set of resource parameters. These provide a uniform interface between Pacemaker and the managed services.
作为Pacemaker和托管服务之间的统一接口,通常由启动,停止和监视资源的脚本和操作系统组件构成
-
Fence agents: These are scripts that execute node fencing actions, given a target and fence device parameters.
作为一种确保节点无法运行服务的能力,可以通过隔离设备(例如切断目标电源的智能电源开关或切断目标设备对本地网络的访问的智能网络开关)来实现。
-
Cluster membership layer: This component provides reliable messaging, membership, and quorum information about the cluster. Currently, Pacemaker supports Corosync as this layer.
提供有关群集的可靠消息传递,成员资格和仲裁信息,支持corosync作为Cluster membership layer
-
Cluster resource manager: Pacemaker provides the brain that processes and reacts to events that occur in the cluster. These events may include nodes joining or leaving the cluster; resource events caused by failures, maintenance, or scheduled activities; and other administrative actions. To achieve the desired availability, Pacemaker may start and stop resources and fence nodes.
作为集群资源管理的大脑,管理集群节点的加入和删除,处理各类资源事件,启停资源以及隔离故障节点
-
Cluster tools: These provide an interface for users to interact with the cluster. Various command-line and graphical (GUI) interfaces are available.
提供与集群的交互入口,有命令行工具,也有GUI工具
Pacemaker自身结构
-
pacemakerd
作为Pacemaker主进程,会生成所有其他守护程序,并在它们意外退出时重新生成它们。
-
pacemaker-attrd
维护所有节点的属性数据,使其在整个群集中保持同步,并处理修改它们的请求,这些属性通常记录在CIB中。
-
pacemaker-based(CIB)
是在内存中的XML数据库,保存了cluster的所有节点和资源的配置和状态。我们查询出来的configuration都是保存在CIB里面。
-
pacemaker-controld
控制器,对于resource做的任何操作都是通过它,维护集群成员的一致视图和编排所有其他组件。
-
pacemaker-execd
负责在本地执行Resource agents并返回结果
-
pacemaker-fenced
在给定目标节点后,执行Fence agents隔离故障节点并返回执行结果
-
pacemaker-schedulerd
调度程序,以给定CIB快照作为输入,由pacemaker-schedulerd确定实现集群所需状态所需的操作
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了