1,开启kafka集群脚本:
cat /export/server/onekey/kafka/slave | while read line
do
{
echo "开始启动 --> "$line
ssh $line "source /etc/profile;nohup sh ${KAFKA_HOME}/bin/kafka-server-start.sh -daemon ${KAFKA_HOME}/config/server.properties >/dev/null 2>&1 &"
}&
wait
done
echo "★★★启动完成★★★"
2,关闭kafka集群脚本:
cat /export/server/onekey/kafka/slave | while read line
do
{
echo "开始停止 --> "$line
ssh $line "source /etc/profile; jps |grep "Kafka" |cut -c 1-5 |xargs kill -s 9"
}&
wait
done
echo "-----停止完成-----"
3,开启kafka-manager脚本:
nohup kafka-manager -Dconfig.file=${KAFKA_MANAGE_HOME}/conf/application.conf >/dev/null 2>&1 &
4,关闭kafka-manager脚本:
echo "正在关闭----"
jps |grep "ProdServerStart" |cut -c 1-5 |xargs kill -s 9
rm -rf /export/server/kafka-manager-1.3.3.17/RUNNING_PID
echo "关闭完成"
其中vi slave内容为
node1
node2
node3