Zookeeper not starting, nohup error

与世无争的帅哥 提交于 2019-12-04 11:49:34

Solution:

Sudo was changing the environment.

So I set the environment variables for root.

Thanks to Elliott Frisch.

simply add following lines to beginning of zkServer.sh

export JAVA_HOME=/usr/lib/jdk
export PATH=$JAVA_HOME/bin:$PATH

btw1: you can make the script executable by:

 sudo chmod a+x zkServer.sh

I suppose that first line is: #!/bin/bash so you can start it by:

sudo zkServer.sh start

BTW2: it is bad practice to run java code as root if it is not rally necessary. good luck.

BTW3: are you sure that you jdk is directly in folder :/usr/jib/jdk and not in some subfolder? You can validate it by running the exports and then try: java -version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!