注意事項:
1.最好使用奇數臺機器。 如果 zookeeper 擁有 5 臺機器,那么它就能處理 2 臺機器的故障了。(FastLeaderELection選舉算法)
2.zoo.cfg中dataDir(數據存放路徑)和dataLogDir(日志輸出路徑)均為絕對路徑。
【參考文章】:
ZooKeeper系列之三:ZooKeeper的安裝
ZooKeeper-3.3.4集群安裝配置
keepalived+nginx雙機熱備+負載均衡
FastLeaderElection選舉算法簡述
自己動手實現zookeeper的FastLeaderELection選舉算法和心跳同步