I have download the zookeeper from https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.5.5/,then I created myid, modify the zoo.cfg, and add the env variable. When I start the service, it failed.
[root@slave2 bin]# ./zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/src/apache-zookeeper-3.5.5/bin/../conf/zoo.cfg
Starting zookeeper ... FAILED TO START
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/zookeeper/server/quorum/QuorumPeerMain
Caused by: java.lang.ClassNotFoundException: org.apache.zookeeper.server.quorum.QuorumPeerMain
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
Could not find the main class: org.apache.zookeeper.server.quorum.QuorumPeerMain. Program will exit.
Finally, I found that there is no jar package in the download file, so I choose another version 3.4.14 and do the same steps above then it's ok.
https://mirrors.tuna.tsinghua.edu.cn/apache/zookeeper/zookeeper-3.4.14/