解压
tar zxf zookeeper-3.4.6.tar.gz
drwxr-xr-x 10 1000 1000 4096 Feb 20 2014 zookeeper-3.4.6
-rwxr-xr-x 1 root root 17699306 Apr 8 23:15 zookeeper-3.4.6.tar.gz
进入解压后的目录cd zookeeper-3.4.6
total 1564
drwxr-xr-x 2 1000 1000 4096 Feb 20 2014 bin
-rw-rw-r-- 1 1000 1000 82446 Feb 20 2014 build.xml
-rw-rw-r-- 1 1000 1000 80776 Feb 20 2014 CHANGES.txt
drwxr-xr-x 2 1000 1000 4096 Feb 20 2014 conf
drwxr-xr-x 10 1000 1000 4096 Feb 20 2014 contrib
drwxr-xr-x 2 1000 1000 4096 Feb 20 2014 dist-maven
drwxr-xr-x 6 1000 1000 4096 Feb 20 2014 docs
-rw-rw-r-- 1 1000 1000 1953 Feb 20 2014 ivysettings.xml
-rw-rw-r-- 1 1000 1000 3375 Feb 20 2014 ivy.xml
drwxr-xr-x 4 1000 1000 4096 Feb 20 2014 lib
-rw-rw-r-- 1 1000 1000 11358 Feb 20 2014 LICENSE.txt
-rw-rw-r-- 1 1000 1000 170 Feb 20 2014 NOTICE.txt
-rw-rw-r-- 1 1000 1000 1770 Feb 20 2014 README_packaging.txt
-rw-rw-r-- 1 1000 1000 1585 Feb 20 2014 README.txt
drwxr-xr-x 5 1000 1000 4096 Feb 20 2014 recipes
drwxr-xr-x 8 1000 1000 4096 Feb 20 2014 src
-rw-rw-r-- 1 1000 1000 1340305 Feb 20 2014 zookeeper-3.4.6.jar
-rw-rw-r-- 1 1000 1000 836 Feb 20 2014 zookeeper-3.4.6.jar.asc
-rw-rw-r-- 1 1000 1000 33 Feb 20 2014 zookeeper-3.4.6.jar.md5
-rw-rw-r-- 1 1000 1000 41 Feb 20 2014 zookeeper-3.4.6.jar.sha1
创建data目录
[root@VM_0_7_centos zookeeper-3.4.6]# mkdir data
进入conf目录
[root@VM_0_7_centos zookeeper-3.4.6]# cd conf
[root@VM_0_7_centos conf]# ll
total 12
-rw-rw-r-- 1 1000 1000 535 Feb 20 2014 configuration.xsl
-rw-rw-r-- 1 1000 1000 2161 Feb 20 2014 log4j.properties
-rw-rw-r-- 1 1000 1000 922 Feb 20 2014 zoo_sample.cfg
mv zoo_sample.cfg zoo.cfg
vim zoo.cfg
将dataDir=/tmp/zookeeper修改为刚刚创建的data目录的路径
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/developer/setup/zookeeper-3.4.6/data
进入bin目录,启动zookeeper
./zkServer.sh start
查看启动状态
./zkServer.sh status