1. 编写脚本 #! /bin/bash case $1 in start){ for i in node01 node02 node03 do ssh $i /opt/module/zookeeper-3.4.10/bin/zkServer.sh start done };; stop){ for i in node01 node02 node03 do ssh $i /opt/module/zookeeper-3.4.10/bin/zkServer.sh stop done };; status){ for i in node01 node