Example 7

Based on the above examples, after the worker node successfully joins a cluster, the container image controller proxy component of the worker node sends an update request to the master node every 5 minutes. The update request content comprises the current node role (master node or worker node) of the node, the operating system, the kernel version of the operating system, and the node transmitting and updating time. Upon receiving this request, the master node updates the data corresponding to these fields in the database. At this time, the master node recursively inquires the update time for each node in the database every 10 minutes and then compares the update time with the current time. If the time difference is within 10 minutes, no operation will be performed. If the time difference is more than 10 minutes, the master node determines this node as a fault node and removes this node from the cluster. Based on the above embodiments, by setting the heartbeat detection program, it is determined whether a worker node operates normally or is disconnected abnormally.

Free full text: Click here