前言
在使用dubbo等需要用到zookeeper,之前window下本地部署,启动一直有问题,后面折腾了下才部署成功,此次记录下来,以备后用。
下载
百度或者google下zookeeper官网,里面就有下载的选项,还有其他的说明。简单下载下来就好了。
What is ZooKeeper?
ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services. All of these kinds of services are used in some form or another by distributed applications. Each time they are implemented there is a lot of work that goes into fixing the bugs and race conditions that are inevitable. Because of the difficulty of implementing these kinds of services, applications initially usually skimp on them ,which make them brittle in the presence of change and difficult to manage. Even when done correctly, different implementations of these services lead to management complexity when the applications are deployed.
Learn more about ZooKeeper on the ZooKeeper Wiki.
配置
将zookeeper下载之后,解压到指定目录即可,无需安装。例如:解压到D:\Program Service Files\zookeeper-3.5.0-alpha。(下载的是3.5.0版本)
解压好了之后,进入conf文件夹,会发现有2个文件,log4j.properties和zoo_sample.cfg这2个文件。对于zoo_sample.cfg文件,需要先将文件名字修改成zoo.cfg文件才行,接下来修改里面配置,如下所示,给出了注释和简单的配置信息。
# ZK中的一个时间单元。ZK中所有时间都是以这个时间单元为基础,进行整数倍配置的。例如,session的最小超时时间是2*tickTime。
tickTime=2000
# Follower在启动过程中,会从Leader同步所有最新数据,然后确定自己能够对外服务的起始