zookeeper在windows平台安装

参阅自官网:https://zookeeper.apache.org/doc/current/zookeeperStarted.html#sc_Download

比较全的配置地址:https://blog.csdn.net/qianshangding0708/article/details/50067483

一、下载

1、通过以下网址下载到zookeeper-3.4.12.tar.gz包:

http://zookeeper.apache.org/releases.html

2、此压缩包可以在windows与Linux运行。

二、安装

1、解压安装包进入F:\ProgramTools\zookeeper-3.4.12\conf目录,有zoo.cfg文件,此文件可以随便取名,内容如下:

# The number of milliseconds of each tick
# ZooKeeper使用的基本时间单位(以毫秒为单位)。 它用于做心跳,最小会话超时将是tickTime的两倍。
tickTime=2000

# The number of ticks that can pass between 
# sending a request and getting an acknowledgement
# 此配置项表示Leader与Follower之间发送消息时,请求和应答时间长度。
# 如果follower在设置时间内不能与leader通信,那么此follower将会被丢弃。
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
# 存储内存数据库快照的位置,除非另有说明,否则指向数据库更新的事务日志。
# 放置事务日志的位置要小心。 专用的事务日志设备是始终如一的良好性能的关键。 将日志置于繁忙的设备上会对性能产生负面影响。
dataDir=F:\\ProgramTools\\zookeeper\\zookeeper-1\\dataDir\\data
#此选项将指示计算机将事务日志写入dataLogDir而不是dataDir。 这允许使用专用的日志设备,并有助于避免日志记录和快照之间的竞争。
# 拥有专用的日志设备会对吞吐量和稳定的延迟产生很大影响。 强烈建议专用日志设备并将dataLogDir设置为指向该设备上的目录,然后确保将dataDir指向不驻留在该设备上的目录。
dataLogDir=F:\\ProgramTools\\zookeeper\\zookeeper-1\\dataDir\\log
# the port at which the clients will connect
# 这个端口就是客户端连接 Zookeeper 服务器的端口,Zookeeper 会监听这个端口,接受客户端的访问请求。
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
# 限制由IP地址标识的单个客户端可以对ZooKeeper集合的单个成员进行的并发连接数(在套接字级别)。 
# 这用于防止某些类别的DoS攻击,包括文件描述符耗尽。 默认值为60.将此值设置为0将完全删除并发连接的限制。
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the 
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
# 启用后,ZooKeeper自动清除功能会分别在dataDir和dataLogDir中保留autopurge.snapRetainCount最新快照和相应的事务日志,并删除其余日志。 默认为3.最小值为3。
# autopurge.snapRetainCount=3
#  Purge task interval in hours
#  Set to "0" to disable auto purge feature
#  必须触发清除任务的时间间隔(以小时为单位)。 设置为正整数(1和更高)以启用自动清除。 默认为0。
# autopurge.purgeInterval=1
# ZooKeeper使用事务日志和快照来持久化每个事务(注意是日志先写)。该配置项指定ZooKeeper在将内存数据库序列化为快照之前,需要先写多少次事务日志。
# 也就是说,每写几次事务日志,就快照一次。默认值为100000。为了防止所有的ZooKeeper服务器节点同时生成快照(一般情况下,所有实例的配置文件是完全相同的),
# 当某节点的先写事务数量在(snapCount/2+1,snapCount)范围内时(挑选一个随机值),这个值就是该节点拍快照的时机。snapCount最小为2,如果设置为1,则默认为2.
snapCount=1
# (Java system property: zookeeper.observer.syncEnabled)
# New in 3.4.6, 3.5.0: The observers now log transaction and write snapshot to disk by default like the participants. 
# This reduces the recovery time of the observers on restart. Set to "false" to disable this feature. Default is "true"
# 观察者现在默认记录事务并将快照写入磁盘,就像参与者一样。 这减少了重启时观察者的恢复时间。 设置为“false”以禁用此功能。 默认为“true”
syncEnabled=true
# (Java system property only: zookeeper.extendedTypesEnabled)
# New in 3.5.4, 3.6.0: Define to "true" to enable extended features such as the creation of TTL Nodes. 
# They are disabled by default. IMPORTANT: when enabled server IDs must be less than 255 due to internal limitations.
# 定义为“true”以启用扩展功能,例如创建TTL节点。 它们默认是禁用的。 重要信息:由于内部限制,启用的服务器ID必须小于255。
zookeeper.extendedTypesEnabled=false

# New in 3.5.4, 3.6.0: Due to ZOOKEEPER-2901 TTL nodes created in version 3.5.3 are not supported in 3.5.4/3.6.0. However, 
# a workaround is provided via the zookeeper.emulate353TTLNodes system property. If you used TTL nodes in ZooKeeper 3.5.3 and 
# need to maintain compatibility set zookeeper.emulate353TTLNodes to "true" in addition to zookeeper.extendedTypesEnabled. NOTE: due to the bug, server IDs must be 127 or less. 
# Additionally, the maximum support TTL value is 1099511627775 which is smaller than what was allowed in 3.5.3 (1152921504606846975)
# 3.5.4,3.6.0中的新功能:由于ZOOKEEPER-2901,3.5.4 / 3.6.0版不支持在3.5.3版中创建的TTL节点。 但是,通过zookeeper.emulate353TTLNodes系统属性提供了一种解决方法。 
# 如果您使用ZooKeeper 3.5.3中的TTL节点,并且除了zookeeper.extendedTypesEnabled之外,还需要将兼容性设置zookeeper.emulate353TTLNodes设置为“true”。 
# 注意:由于该错误,服务器ID必须为127或更少。 此外,最大支持TTL值为1099511627775,小于3.5.3(1152921504606846975)中允许的值
zookeeper.emulate353TTLNodes=false


# -----------------------------------Cluster Options-------------------------
# The options in this section are designed for use with an ensemble of servers -- that is, when deploying clusters of servers.
# -------------------------下面是集群配置,单机不用配置也可------------------
# electionAlg
# (No Java system property)
# Election implementation to use. A value of "0" corresponds to the original UDP-based version, "1" corresponds to 
# the non-authenticated UDP-based version of fast leader election, "2" corresponds to the authenticated UDP-based version of 
# fast leader election, and "3" corresponds to TCP-based version of fast leader election. Currently, algorithm 3 is the default
# Note
# The implementations of leader election 0, 1, and 2 are now deprecated . We have the intention of removing them in the next release,
# at which point only the FastLeaderElection will be available.
# electionAlg
# (没有Java系统属性)
# 选举实施使用。 值“0”对应于原始的基于UDP的版本,“1”对应于未经认证的基于UDP的快速领导者选举版本,
# “2”对应于经认证的基于UDP的快速领导者选举版本,以及 “3”对应于基于TCP的快速领导者选举版本。 目前,算法3是默认值
# 注意
# 现在不推荐使用领导者选举0,1和2的实现。 我们打算在下一个版本中删除它们,此时只有FastLeaderElection可用。
 electionAlg=3


# The number of ticks that the initial 
# synchronization phase can take
# 此配置表示
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值