查看zookeeper.out
[work@xxx zookeeper-3.4.6]$cat zookeeper.out
nohup: failed to run command `/usr/java/jdk1.8.0_65//bin/java': No such file or directory
这里可以看到是系统的环境变量有问题了!!!
查看系统环境变量
[work@xxx zookeeper-3.4.6]$ export
declare -x CVS_RSH="ssh"
declare -x G_BROKEN_FILENAMES="1"
declare -x HISTCONTROL="ignoredups"
declare -x HISTSIZE="1000"
declare -x HISTTIMEFORMAT="%F %T work "
declare -x HOME="/home/work"
declare -x JAVA_HOME="/usr/java/jdk1.8.0_65/"
果然TM有问题!
修改系统环境变量
[work@xxx zookeeper-3.4.6]$ export JAVA_HOME=/usr
再次启动zookeeper
[work@xxx zookeeper-3.4.6]$ bin/zkServer.sh start
JMX enabled by default
Using config: /home/work/soft/zookeeper-3.4.6/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
我的是自己账户不可以切换成root就可以了,用户之间的环境不一样导致