kafka集群启动命令脚本文件kf.sh
注意代码缩进
添加执行权限
chmod +x kf.sh
1 #! /bin/bash
2 case $1 in
3 "start"){
4 for i in hadoop102 hadoop103 hadoop104
5 do
6 echo " --------启动 $i Kafka-------"
7 ssh $i "/opt/module/kafka/bin/kafka-server-start.sh -daemon /opt/module/kafka/config/server.properties"
8 done
9 };;
10 "stop"){
11 for i in hadoop102 hadoop103 hadoop104
12 do
13 echo " --------停止 $i Kafka-------"
14 ssh $i "/opt/module/kafka/bin/kafka-server-stop.sh "
15 done
16 };;
17 esac
好看请赞,养成习惯:) 本文来自博客园,作者:靠谱杨, 转载请注明原文链接:https://www.cnblogs.com/rainbow-1/p/16015749.html
欢迎来我的51CTO主页踩一踩~ 我的51CTO博客
文章内出现的订阅h统一搜索:靠谱杨阅读人生