1 #!/bin/sh 2 case $1 in 3 "start"){ 4 echo "-----------启动zookeeper------------------" 5 /opt/module/zookeeper/bin/zkServer.sh $1 6 ssh hadoop107 "/opt/module/zookeeper/bin/zkServer.sh $1" 7 ssh hadoop108 "/opt/module/zookeeper/bin/zkServer.sh $1" 8 };; 9 "stop"){ 10 echo "-----------启动zookeeper------------------" 11 /opt/module/zookeeper/bin/zkServer.sh $1 12 ssh hadoop107 "/opt/module/zookeeper/bin/zkServer.sh $1" 13 ssh hadoop108 "/opt/module/zookeeper/bin/zkServer.sh $1" 14 };; 15 "status"){ 16 echo "-----------启动zookeeper------------------" 17 /opt/module/zookeeper/bin/zkServer.sh $1 18 ssh hadoop107 "/opt/module/zookeeper/bin/zkServer.sh $1" 19 ssh hadoop108 "/opt/module/zookeeper/bin/zkServer.sh $1" 20 };; 21 "zk"){ 22 /opt/module/zookeeper/bin/zkCli.sh 23 };; 24 *){ 25 echo "====用法==启动==停止==状态==客户端==" 26 echo "$0 {start|stop|status|zk}" 27 };; 28 esac
#!/bin/sh case $1 in "start"){ echo "-----------启动zookeeper------------------" /opt/module/zookeeper/bin/zkServer.sh $1 ssh hadoop107 "/opt/module/zookeeper/bin/zkServer.sh $1" ssh hadoop108 "/opt/module/zookeeper/bin/zkServer.sh $1" };; "stop"){ echo "-----------启动zookeeper------------------" /opt/module/zookeeper/bin/zkServer.sh $1 ssh hadoop107 "/opt/module/zookeeper/bin/zkServer.sh $1" ssh hadoop108 "/opt/module/zookeeper/bin/zkServer.sh $1" };; "status"){ echo "-----------启动zookeeper------------------" /opt/module/zookeeper/bin/zkServer.sh $1 ssh hadoop107 "/opt/module/zookeeper/bin/zkServer.sh $1" ssh hadoop108 "/opt/module/zookeeper/bin/zkServer.sh $1" };; "zk"){ /opt/module/zookeeper/bin/zkCli.sh };; *){ echo "====用法==启动==停止==状态==客户端==" echo "$0 {start|stop|status|zk}" };; esac