window下安装zookeeper
本地zookeeper安装(win7)
下载zookeeper-3.3.6.zip文件
解压zookeeper-3.3.6.zip文件到d:盘
在D:\zookeeper-3.3.6\conf下增添 zoo.cfg
copy此zoo_sample.cfg生成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 stored.
#镜像数据位置
dataDir=d:\\data\\zookeeper
#日志位置
dataLogDir=d:\\logs\\zookeeper
#客户端连接的端口
clientPort=2181
启动zookeeper
D:\zookeeper-3.3.6\bin\zkServer.cmd
启动后jps可以看到QuorumPeerMain的进程
启动客户端运行查看一下
D:\zookeeper-3.3.6\bin\zkCli.cmd
查看命令
[zk: localhost:2181(CONNECTED) 5] help
ZooKeeper -server host:port cmd args
connect host:port
get path [watch]
ls path [watch]
set path data [version]
delquota [-n|-b] path
quit
printwatches on|off
create [-s] [-e] path data acl
stat path [watch]
close
ls2 path [watch]
history
listquota path
setAcl path acl
getAcl path
sync path
redo cmdno
addauth scheme auth
delete path [version]
setquota -n|-b val path
ls \命令查看当前节点数据
[zk: localhost:2181(CONNECTED) 4] ls /
[zookeeper]
zookeeper安装成功