High Availability手册(2): 架构

image

最底层是通信层corosync/openais

负责cluster中node之间的通信

上一层是Resource Allocation Layer,包含下面的组件:

CRM Cluster Resouce Manager

是总管,对于resource做的任何操作都是通过它。每个机器上都有一个CRM。

CIB Cluster Information Base

CIB由CRM管理,是在内存中的XML数据库,保存了cluster的配置和状态。我们查询出来的configuration都是保存在CIB里面的。nodes, resources, constraints, relationship.

DC Designated Coordinator

每个node都有CRM,会有一个被选为DC,是整个Cluster的大脑,这个DC控制的CIB是master CIB,其他的CIB都是副本。

PE Policy Engine

当DC需要进行一些全局配置的时候,首先由PE根据当前的状态和配置,计算出将来的状态,并生成一系列的action,使得cluster从初始状态变为结果状态。PE仅仅在DC上运行。

LRM Local Resource Manager

本地的resource管理,调用resource agent完成操作,启停resource,将结果返回给CRM

再上一层是Resource Layer

包含多个resource agent。resource agent往往是一些shell script,用来启动,停止,监控resource的状态。

root@pacemaker01:~# ps aux | grep pace
root      3363  0.0  0.1  81812  3748 ?        Ss   Jul28   0:06 /usr/lib/pacemaker/lrmd
haclust+  3365  0.0  1.1 114428 23808 ?        Ss   Jul28   0:03 /usr/lib/pacemaker/pengine
root     20103  0.0  0.2 107496  4532 pts/2    S    10:06   0:00 pacemakerd
haclust+ 20105  0.0  0.6 110244 12560 ?        Ss   10:06   0:00 /usr/lib/pacemaker/cib
root     20106  0.0  0.3 107248  6680 ?        Ss   10:06   0:00 /usr/lib/pacemaker/stonithd
haclust+ 20107  0.0  0.2  96640  4148 ?        Ss   10:06   0:00 /usr/lib/pacemaker/attrd
haclust+ 20108  0.0  0.4 166536  9172 ?        Ss   10:06   0:00 /usr/lib/pacemaker/crmd

流程

比如要添加一个Cluster IP

  1. 命令行将Cluster IP加入CIB
  2. DC将CIB的修改同步到所有的crmd
  3. DC上的PE计算如何部署这个Cluster IP,在哪个node上,做什么操作
  4. DC将操作列表同步到所有的crmd
  5. 每个crmd调用本地的lrmd做真正的部署
  6. lrmd调用resource agent来启动或者停止一些操作
  7. lrmd操作完,将结果返回给DC
posted @ 2014-07-29 15:01  popsuper1982  阅读(1478)  评论(0编辑  收藏  举报