标签:脚本 code local color add tar style div cas
jdk 路径为/usr/local/java
zk路径为/use/local/zookeeper
cd /etc/rc.d/init.d/ vim zookeeper # 添加如下脚本 #!/bin/bash ZK_PATH=/usr/local/zookeeper export JAVA_HOME=/usr/local/java case $1 in start) sh $ZK_PATH/bin/zkServer.sh start;; stop) sh $ZK_PATH/bin/zkServer.sh stop;; status) sh $ZK_PATH/bin/zkServer.sh status;; restart) sh $ZK_PATH/bin/zkServer.sh restart;; *) echo "require start|stop|status|restart" ;; esac
保存
#将脚本注册为service chkconfig --add zookeeper # 查看 chkconfig --list
#启动
service zookeeper start
#停止
service zookeeper stop
#重新启动
service zookeeper restart
# 查看状态
service zookeeper status
标签:脚本 code local color add tar style div cas
原文地址:https://www.cnblogs.com/geekdc/p/10922580.html