以下是在Linux中搭建Zookeeper集群的基本步驟:
/etc/hosts中配置IP地址映射。/usr/local/zookeeper,可重命名目錄。/var/lib/zookeeper,在每個節點的配置文件zoo.cfg中設置dataDir等參數,配置集群信息server.X=host:port:port。myid文件,寫入對應節點ID。./zkServer.sh start啟動服務。./zkServer.sh status查看節點狀態,應有leader和follower。