# zookeeper入门
# zk配置文件说明
# 数据目录
dataDir=/home/jesse/kafka/zookeeper/zk1
# 日志目录,不能存放在比较繁忙的设备上,会影响性能
dataLogDir=/home/jesse/kafka/log/zk1
# the port at which the clients will connect
clientPort=2181
# disable the per-ip limit on the number of connections since this is a non-production config
# 限制zookeeper的客户端链接数量,设置为0或者不设置表示取消对并发连接的设置
maxClientCnxns=100
# 最小会话超时时间和最大会话超时时间
minSessionTimeout=4000
maxSessionTimeout=10000
# Disable the adminserver by default to avoid port conflicts.
# Set the port to something non-conflicting if choosing to enable this
# admin.enableServer=false
# admin.serverPort=8080
# server.id 其中id表示这是第几号server,用来做集群中的区别的192.168.9.103是该server所在的ip地址;2888是该server和集群leader通信端口,3888是选举leader的端口
server.1=192.168.3.29:2881:3881
server.2=192.168.3.29:2882:3882
server.3=192.168.3.29:2883:3883
tickTime=2000
initLimit=10
syncLimit=5
# dataDir中的myid文件
写入一个数字,表示第几个server,与zk.properties中server.id的id对应。
# 同一台机器上启动三个zk
- clientPort要设置3个不同的端口
- server.id要设置三个不同端口