Zookeeper 未启动,nohup 错误 [英] Zookeeper not starting, nohup error

查看:67
本文介绍了Zookeeper 未启动,nohup 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经下载了zookeeper-3.4.5.tar.gz,解压后我把conf/zoo.cfg写成

I have Downloaded zookeeper-3.4.5.tar.gz and after extracting it I wrote conf/zoo.cfg as

tickTime=2000

dataDir=/var/zookeeper

clientPort=2181

现在我尝试通过 bin/zkServer.sh start 启动zookeeper它给

Now I tried to start zookeeper by bin/zkServer.sh start it gives

mohit@mohit:~/zookeeper-3.4.5/bin$ sudo sh zkServer.sh start
[sudo] password for mohit: 
JMX enabled by default
Using config: /home/mohit/zookeeper-3.4.5/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED

但是

$ echo ruok | nc localhost 2181

没有给出任何输出.

我检查了zookeeper.out,它给了

I checked zookeeper.out, it gives

mohit@mohit:~/zookeeper-3.4.5/bin$ cat zookeeper.out 
nohup: failed to run command ‘java’: No such file or directory
mohit@mohit:~/zookeeper-3.4.5/bin$ 

但是我的 JAVA 变量设置了,我不明白为什么会出现这个错误?

But my JAVA variables are set, I am not getting why this error is coming?

mohit@mohit:~/zookeeper-3.4.5/bin$ echo $JAVA_HOME 
/usr/lib/jdk
mohit@mohit:~/zookeeper-3.4.5/bin$ echo $PATH 
/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jdk/bin

请帮忙.提前致谢:)

推荐答案

解决方案:

Sudo 正在改变环境.

Sudo was changing the environment.

所以我为 root 设置了环境变量.

So I set the environment variables for root.

感谢 Elliott Frisch.

Thanks to Elliott Frisch.

这篇关于Zookeeper 未启动,nohup 错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆