windows下安装ZOOKEEPER失败

今天才接触DUBBO,在安装DUBBO的注册中心——zookeeper时,老是提示JAVA_HOME incorrently set

这个错误简单明了,但是,回头检查,我的JAVA_HOME是正常的,运行javac\java命令都没有问题,如果你也遇到了这种问题,答案是:

jdk安装在了d:\program file\这个文件夹下,估计主要是program file这个文件夹的原因,我在zookeeper的配置文件中没有找到可以修改指定JAVA_HOME的地方,只要卸载重新安装了一次,然后就通过了。借网上大牛的经验,提供zookeeper的安装方法:

1.下载zookeeper:http://www.apache.org/dyn/closer.cgi/zookeeper/

   这里下载的是.gz文件,不用怕,多解压几次就得到windows可以识别的文件夹了

2.把解压的文件夹放到指定地方:E:\javaTool\zookeeper-3.4.7\,修改conf文件夹下的zoo_simple.conf文件,修改如下:

# 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=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181

 3.运行cmd命令,cd到e:\javaTool\zookeeper-3.4.7\bin下面,键入zkService.cmd,就OK了

4.注意第2步的dataDir、dataLogDir指定为你任意的文件夹,clientPort未被占用

猜你喜欢

转载自1015786613.iteye.com/blog/2264299