In distributed system, ZooKeeper is a common coordination service. Its election algorithm is one of the core algorithms in
ZooKeeper cluster, which ensures the high availability and consistency of ZooKeeper. However, the time overhead in the election process
can aff ect the performance of the entire cluster. In order to improve the effi ciency of ZooKeeper cluster election, this paper studies the
election time optimization method of ZooKeeper cluster distributed coordination service based on Raft algorithm, analyzes the mechanism
of ZooKeeper election algorithm, puts forward the main sources of election time cost, and introduces the basic principle and characteristics
of Raft algorithm. And apply it to ZooKeeper election to reduce the number and complexity of election messages by pruning and batch
processing technology. Finally, this paper verifi es the eff ectiveness of the optimization method through experiments, and compares it with
other algorithms