1.JDK安装
在我的部署单节点kafka的博客里有相关的方法。(https://www.cnblogs.com/ToBeExpert/p/9789486.html )zookeeper和kafka的压缩包下载地址也在单节点部署的这篇博客里。
1.zookeeper集群的搭建
将zookeeper.tar.gz解压为三个目录,例如:
以上图中的目录结构为例,进入./zookeeper-1/conf。找到zoo.cfg文件,如果没有就复制一份zoo_sample.cfg并将其改名为zoo.cfg,zoo.cfg是zookeeper的配置文件。如下:
在部署zookeeper集群之前,一定要记得将已经运行的zookeeper节点停止。现在修改zoo.cfg的配置。
# The number of milliseconds of each tick
tickTime=2000# The number of ticks that the initial
# synchronization phase can take
initLimit=10# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5# the directory where the snapshot is sto