黑猴子的家:zk.sh
2022-09-09 本文已影响0人
黑猴子的家
#!/bin/bash
user=`whoami`
zookeeper_home='/opt/module/zookeeper-3.5.9'
echo -e "================ 正在启动Zookeeper ==========="
case $1 in
start | stop | status)
for((host=102; host<=104; host++)); do
echo -e "\n---${user}@hadoop${host}---"
ssh ${user}@hadoop${host} "${zookeeper_home}/bin/zkServer.sh $1"
done
;;
*)
echo "你启动的姿势不对"
echo " start 启动zookeeper集群"
echo " stop 停止zookeeper集群"
echo " status 查看zookeeper集群"
;;
esac