kafka集群启动和停止

1、启动
先启动zk集群
然后在所有节点执行脚本
nohup kafka-server-start.sh /kkb/install/kafka/config/server.properties >/dev/null 2>&1 &
一键启动kafka
start_kafka.sh

!/bin/sh

for host in node01 node02 node03
do
ssh host kafka is running"

done
2、停止
所有节点执行关闭kafka脚本
kafka-server-stop.sh
一键停止kafka
stop_kafka.sh

!/bin/sh

for host in node01 node02 node03
do
ssh host kafka is stopping"
done

3、一键启动和停止脚本
kafkaCluster.sh

!/bin/sh

case host "source /etc/profile; nohup /kkb/install/kafka/bin/kafka-server-start.sh /kkb/install/kafka/config/
server.properties > /dev/null 2>&1 &"
echo "$host kafka is running..."
done
};;

"stop"){
for host in node01 node02 node03
do
ssh host kafka is stopping..."
done
};;
esac
启动
sh kafkaCluster.sh start
停止
sh kafkaCluster.sh stop

你可能感兴趣的:(kafka集群启动和停止)