转自:http://www.jianshu.com/p/f7037105db46
首先要确保机器已经安装好java环境,并且配置好环境变量
![](http://upload-images.jianshu.io/upload_images/2518871-694fd2f7c3a46aa5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](http://upload-images.jianshu.io/upload_images/2518871-6d21c1f00206303d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
下载后,解压缩到硬盘,我这里解压到了 D:\WorkSoftware\zookeeper_3.4.9
![](http://upload-images.jianshu.io/upload_images/2518871-b1da76f245df866e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
解压缩
在 D:\WorkSoftware\zookeeper_3.4.9 下建立一个空文件夹 data
![](http://upload-images.jianshu.io/upload_images/2518871-c05e4a534c229383.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
建立data文件夹
进入到conf目录,然后复制zoo_sample.cfg为zoo.cfg
![](http://upload-images.jianshu.io/upload_images/2518871-6b6b455792eb7bab.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
复制zoo_sample.cfg
编辑dataDir部分
![](http://upload-images.jianshu.io/upload_images/2518871-f0e918ca9ec6b11e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
编辑dataDir
启动Zookeeper,进入 bin 目录,执行 zkServer.cmd
![](http://upload-images.jianshu.io/upload_images/2518871-2c918ef9d8731105.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
启动Zookeeper
![](http://upload-images.jianshu.io/upload_images/2518871-b553eef950004bf0.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
默认绑定端口2181
作者:sphsyv
链接:http://www.jianshu.com/p/f7037105db46
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。