一、在zkEnv.sh中指定当前用户jdk环境变量
export JAVA_HOME=/usr/local/src/jdk1.7.0_55/shell
二、在/etc/rc.d/init.d文件夹下建立zookeeper文件
内容:bash
#!/bin/bash #chkconfig:2345 20 90 case $1 in start) su root /usr/local/src/zookeeper-3.4.6/bin/zkServer.sh start;; *) echo "require start/stop/status/restart" ;; esac
三、用命令chmod 修改一下zookeeper文件权限
chmod u+x zookeeperui
四、chkconfig --add zookeeper 添加启动服务(默认就能自启动)
chkconfig --list 查看是否添加成功.net
参考:https://blog.csdn.net/leadseczgw01/article/details/53502099rest