You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 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 stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181
Zookeeper 是个分布式开源框架,之前在做分布式日志收集的时候,就使用到,Zookeeper搭建比较简单。
下载
目前最新稳定版本:3.4.10, 下载地址
进入 stable 目录下载:
下载后解压:
单点模式启动
使用默认配置,启动监听端口:2181
默认情况下,zkServer.sh 加载
../conf/zoo.cfg
配置文件,配置文件主要有下面内容:可以修改
dataDir
的目录,Zookeeper暴露给客户端的端口。集群模式
步骤1:配置文件增加节点信息
分别在不同的节点A、B、C机器上下载Zookeeper,并且解压,在默认配置文件基础上,添加下面的节点信息:
说明:
2888
端口: Zookeeper 各个节点之间的通信端口;3888
端口: Zookeeper 选择Leader的端口;步骤2:配置当前节点的ID
注意:
server.X
;/tmp/zookeeper
改为实际 Zookeeper 配置文件中的dataDir
路径;Zookeeper 服务启动的时候,会在 Zookeeper DataDir 目录查找 myid文件,里面的数字即表示当前的节点是
server.X
.步骤3:各个节点分别启动服务
参考链接
The text was updated successfully, but these errors were encountered: