升木 发表于 2015-9-6 10:47:38

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
查看命令
help
ZooKeeper -server host:port cmd args
      connect host:port
      get path
      ls path
      set path data
      delquota [-n|-b] path
      quit
      printwatches on|off
      create [-s] [-e] path data acl
      stat path
      close
      ls2 path
      history
      listquota path
      setAcl path acl
      getAcl path
      sync path
      redo cmdno
      addauth scheme auth
      delete path
      setquota -n|-b val path
ls \命令查看当前节点数据
ls /

zookeeper安装成功
页: [1]
查看完整版本: window下安装zookeeper