#! /bin/bash
case $1 in
"start"){
for i in hadoop110 hadoop111 hadoop112
do
echo ======$i======
ssh $i "source /etc/profile && /opt/module/zookeeper-3.5.7/bin/zkServer.sh start"
done
};;
"stop"){
for i in hadoop110 hadoop111 hadoop112
do
echo ======$i======
ssh $i "source /etc/profile && /opt/module/zookeeper-3.5.7/bin/zkServer.sh stop"
done
};;
"status"){
for i in hadoop110 hadoop111 hadoop112
do
echo ======$i======
ssh $i "source /etc/profile && /opt/module/zookeeper-3.5.7/bin/zkServer.sh status"
done
};;
esac
注意集群名称修改
启动传参start
停止传参stop
文章来源:https://www.toymoban.com/news/detail-612230.html
查看状态传参status
文章来源地址https://www.toymoban.com/news/detail-612230.html
到了这里,关于zookeeper集群启停及状态查看脚本(linux)的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!