lhdz_bj

Heartbeat is a pooling mechanism in clustered platforms to verify if the other server participating in the cluster is alive. Oracle also uses the heartbeat mechanism to verify the health of the other nodes participating in the cluster.In a RAC cluster , every node will poll the other node in the cluster,This helps each server in the cluster to understand the health of the other server in the cluster and take appropriate actions should polling fail. In RAC, the CSS performs polling in three different methods:

1)Network Heartbeat (NHB)

2)Disk Heartbeat (DHB)

3) Local Heartbeat (LHB)

1)Network Heartbeat (NHB)
The NHB is sent over the private interconnect. CSS sends an NHB every second from one node to all the other nodes in a cluster and receives an NHB from the remote nodes similarly every second. The NHB contains timestamp information from the local node and is used by the remote. If an acknowledgment is not received from the other node
in the cluster in 30 seconds (represented by the miscount value), CSS would request a cluster reconfiguration. The reconfiguration will not always be required. CSS will verify the health and state of the node through other methods before making a decision for reconfiguration.

2)Disk Heartbeat (DHB)
Apart from the NHB, we use the DHB, which is required for split-brain resolution. It contains a timestamp of the local time in Unix epoch seconds as well as a millisecond timer. The DHB is the definitive mechanism to make a decision about whether a node is still alive. DHB is a mechanism where each server in the cluster will write a timestamp to the voting disk every second. In the case of NHB failure, CSS will verify the voting disk to check if the node in question has written any timestamp to the voting disk during the NHB missed timeframe to decide if cluster reconfiguration is required.

3)Local Heartbeat (LHB)
LHB is an internal heartbeat mechanism where the message is sent to the cssdmonitor and the cssdagent to keep them informed about the health of the CSS. LHB notifications also happen every second and use and share the same thread with the NHB and DHB.

 

此外,我们还需要思考

1)当split-brain发生时,如何判断哪些节点存活下去?谁来计算和判断?根据什么来计算和判断?这些搞清楚,就差不多了。

2)上面介绍的是cluster层面的心跳,除此之外,Oracle层面也有自己的心跳机制,那就是通过ckpt进程和control files实现的,这里就不具体讲述了。

 

相关文章: