win下载安装zookeeper

ZooKeeper是Hadoop的正式子项目,它是一个针对大型分布式系统的可靠协调系统,提供的功能包括:配置维护、名字服务、分布式同步、组服务等。ZooKeeper的目标就是封装好复杂易出错的关键服务,将简单易用的接口和性能高效、功能稳定的系统提供给用户

下载
http://mirrors.cnnic.cn/apache/zookeeper/zookeeper-3.3.6/zookeeper-3.3.6.tar.gz
解压
进入${zookeeper}/config
重新命名 zoo_sample.cfg --> zoo.cfg
修改dataDir=/tmp/zookeeper --> dataDir=F:\\taobao\\zookeeper-3.3.6\\data
新增 dataLogDir=F:\\taobao\\zookeeper-3.3.6\\logs
其余的不用改
Cmd命令行进入到${zookeeper}/bin
F:\taobao\zookeeper-3.3.6\bin>zkServer.cmd
看到控制打印出一串信息
F:\taobao\zookeeper-3.3.6\bin>zkCli.cmd -server 127.0.0.1:2181
Connecting to 127.0.0.1:2181
2014-05-25 19:13:29,311 - INFO  [main:Environment@97] - Client environment:zooke
eper.version=3.3.6-1366786, built on 07/29/2012 06:22 GMT
2014-05-25 19:13:29,314 - INFO  [main:Environment@97] - Client environment:host.
name=E97M3HS2ANMGCSZ
2014-05-25 19:13:29,315 - INFO  [main:Environment@97] - Client environment:java.
version=1.8.0_05
2014-05-25 19:13:29,315 - INFO  [main:Environment@97] - Client environment:java.
vendor=Oracle Corporation
2014-05-25 19:13:29,315 - INFO  [main:Environment@97] - Client environment:java.
home=C:\Program Files\Java\jre8
。。。。。。
总之没有错误信息 表示成功了。

不关闭当前窗口,另外打开一个cmd命令行
进入${zookeeper}/bin
F:\taobao\zookeeper-3.3.6\bin>zkCli.cmd -server 127.0.0.1:2181
控制台没有报错表示成功
[zk: 127.0.0.1:2181(CONNECTED) 0]
WATCHER::

WatchedEvent state:SyncConnected type:None path:null
输入 ls


WatchedEvent state:SyncConnected type:N
ls
ZooKeeper -server host:port cmd args
        stat path [watch]
        set path data [version]
        ls path [watch]
        delquota [-n|-b] path
        ls2 path [watch]
        setAcl path acl
        setquota -n|-b val path
        history
        redo cmdno
        printwatches on|off
        delete path [version]
        sync path
        listquota path
        get path [watch]
        create [-s] [-e] path data acl
        addauth scheme auth
        quit
        getAcl path
        close
        connect host:port
[zk: 127.0.0.1:2181(CONNECTED) 1] ls /
[zookeeper]
[zk: 127.0.0.1:2181(CONNECTED) 2]

这样zookeeper就按照好了。

你可能感兴趣的:(java,zookeeper)