什么是 HACMP?
Hacmp is an application which:
-monitors cluster components
-detects status changes
-diagnoses and recovers from failure and …
-reintegrates previous failed components back in to the cluster upon recovery.
HACMP 的配置
上面是典型配置,一个集群中有两个节点,每个节点有两个网卡。所有网卡在同一个 VLAN。
每个网卡配有 bootip,系统启动时用
Serviceip 是在系统后,cluster 启动时所用地址,不同的 IP 接管方式(IP address takeover),
service ip 配在不同的网卡上。
1. IP address takeover(IPAT) via IP replacement
Base,stby(standy) 都是 boot ip
Svc 是 service ip
en1(base/stby), en1 被指定为 standy interface,在 IPAT via IP replacement,standy
interface 不能被用做 service ip。
Ip 地址要求:service ip 和 boot ip 在同一个子网中,standy ip 在另一个子网中。
两个 boot ip 在不同子网中的原因:
多路径路由,在同一个子网中有多个网卡,系统会随机选择网卡发送信息,heartbeat
不能准确判定每个网卡的状态
2. IP address takeover(IPAT) via IP aliases
Service ip 配置的时候不替换已经存在的 ip,当 hacmp 启动时,svc 被配置在 boot ip
的上面,ip aliases 允许多个 ip 存在一个通讯接口上。
Ip 地址要求:所有的 ip 地址都必须在不同的子网内。
Pers:persistent ip 永久 ip,方便管理。
在 hacmp 5.1 以上,IPAT 默认方法是 aliase
Hacmp 心跳(KA message)
Hacmp 能处理三种类型的故障
1.network interface card(NIC) failures
2.node failures
3.network failures
但为了发现故障,hacmp 必须时刻监视集群的各个组成,这就需要心跳信息(heartbeat)
上面是两节点的 hearbeat 配置,在多个节点的情况下,需满足下面的情况
1.所有的网卡都能发送 heartbeat packet
2.所有的网卡都能接收 heartbeat packet
3.只需要满足上面两个条件,没有多余的 packet 发送接收
当 bondar 的 en1 有故障时,与 hudson 的 en1 心跳通讯会断掉,这时,经过不同的网卡组合
来发送 diagnostic packet 来确定是 bondar en1 有故障,还是 hudson en1 有故障
Hearbeat 方式
1. 通过 ip 网络 不配置的时候也可以发送 heartbeat packet,或者配置成 heart over IP
aliases
2. 通过非 ip 网络 串口心跳,磁盘心跳
Heartb over IP aliases
Instead of using the base/boot ip address for exchanging heartbeat messages,RSCT uses the
HACMP defined IP aliases to establish the communication groups(heartbeat rings) for each
communication interface
通过 aliase 交换心跳信息,IPAT 会有些变化。
IPAT via replacement: the service ip label will replace the boot ip address on the interface,the
heartbeat ip alias address remains
IPAT via aliasing: the service ip label will be added as an alias on the interface with the heartbeat
ip alias
基于磁盘的心跳要求
1. 一个磁盘可以用来做两个节点间的网络,这个磁盘在两个节点上使用相同的唯一的特定
的标识的 PVID
2. 推荐在一个存储范围内的一对节点间(或则一个磁盘柜)的一个磁盘配置磁盘心跳网络
3. 该磁盘需要是增强并发卷组的一部分,虽然并不要求卷组激活或者是资源组的一部分。
仅仅的限制是 VG 必须同时定义在两个节点上。
资源组(resource group)
资源组是一个包含 HACMP 执行高可用资源的一个逻辑实体。资源包括:
存储空间(应用程序的代码和数据)
文件系统
网络文件系统
裸逻辑卷
裸物理磁盘
服务 IP 地址/标签(客户端连接应用时使用)
应用服务器
应用启动的脚本
应用停止的脚本