zookeeper集群启动脚本
时间: 2023-08-24 08:07:50 浏览: 121
以下是一个zookeeper集群启动脚本的示例:
#!/bin/bash
case $1 in
"start"){
for i in hadoop102 hadoop103 hadoop104
do
echo ---------- 启动 zookeeper 服务 on $i ------------
ssh $i "/opt/module/zookeeper-3.5.7/bin/zkServer.sh start"
done
};;
"stop"){
for i in hadoop102 hadoop103 hadoop104
do
echo ---------- 停止 zookeeper 服务 on $i ------------
ssh $i "/opt/module/zookeeper-3.5.7/bin/zkServer.sh stop"
done
};;
"status"){
for i in hadoop102 hadoop103 hadoop104
do
echo ---------- 查看 zookeeper 服务状态 on $i ------------
ssh $i "/opt/module/zookeeper-3.5.7/bin/zkServer.sh status"
done
};;
esac
这个脚本可以通过执行不同的命令参数来启动、停止和查看zookeeper集群的状态。对于每个服务器,脚本会通过SSH连接执行相应的命令。你可以根据自己的集群配置和实际需求修改脚本中的服务器列表和路径。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [创建一个启动/关闭Zookeeper集群的脚本](https://blog.csdn.net/BIPT919/article/details/124702356)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [Zookeeper - 集群搭建 + 群起集群脚本](https://blog.csdn.net/Trollz/article/details/126657569)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文