zookeeper启动、停止、查看状态脚本
- #!/bin/bash
-
- #作者:weibo
- #时间:2021.11.30
-
- case $1 in
- "start"){
- for i in zookeeper01 zookeeper02 zookeeper03
- do
- echo ==================$i 启动===================
- ssh $i "/opt/zookeeper-3.5.7/bin/zkServer.sh start"
- done
- }
- ;;
- "stop"){
- for i in zookeeper01 zookeeper02 zookeeper03
- do
- echo ==================$i 停止===================
- ssh $i "/opt/zookeeper-3.5.7/bin/zkServer.sh stop"
- done
- }
- ;;
- "staus"){
- for i in zookeeper01 zookeeper02 zookeeper03
- do
- echo ==================$i 查看状态===================
- ssh $i "/opt/zookeeper-3.5.7/bin/zkServer.sh staus"
- done
- }
- ;;
- esac
-