ZooKeeper脚本

ZooKeeper脚本,第1张

ZooKeeper脚本
#!/bin/bash

case  in
"start"){
            # 部署的机器名称
        for i in zhaohui01 zhaohui02 zhaohui03
        do
                echo --------- zookeeper $i 启动-----------
                # zookeeper的bin目录
                ssh $i "/opt/zookeeper-3.5.7/bin/zkServer.sh start"
        done
                echo --------- zookeeper启动完成-----------
}
;;
"stop"){
for i in zhaohui01 zhaohui02 zhaohui03
        do
                echo --------- zookeeper $i 停止-----------
                ssh $i "/opt/zookeeper-3.5.7/bin/zkServer.sh stop"
        done
                echo --------- zookeeper停止完成-----------
}
;;
"status"){
for i in zhaohui01 zhaohui02 zhaohui03
        do
                echo --------- zookeeper $i 状态-----------
                ssh $i "/opt/zookeeper-3.5.7/bin/zkServer.sh status"
        done

}
;;
esac

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5688693.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存