Abstract:In view of the issue that the traditional Raft algorithm has candidate nodes grabbing votes, causing abnormal elections to occur, a Raft algorithm based on random forest is proposed to improve the authorized nodes. First, the authorized attributes are added to the original Raft algorithm, and only the authorized nodes are set to be eligible for candidacies; secondly, a random forest algorithm is introduced to classify the authorized attributes of the nodes, that is, to determine whether the node is an improved node or an ordinary node, and then select the improved nodes to form the main consensus group; finally, the scoring ranking method is used in the main consensus group to set the improved node with the highest score as the authorized node. The experimental results of this algorithm show that the improved Raft algorithm not only avoids the occurrence of abnormal elections, but also improves its election efficiency.