kafka 群起脚本kafka.sh
#!/bin/bashcase $1 in "start"){for i in backup01 backup02 backup03do echo "========== $i ==========" ssh $i '/usr/local/hadoop/kafka/kafka_2.12-2.4.1/bin/kafka-server-start.sh -daemon /usr/local/hadoop/kafka/kafka_2.12-2.4.1/binconfig/server.properties' done
};;
"stop"){for i in backup01 backup02 backup03do echo "========== $i ==========" ssh $i '/usr/local/hadoop/kafka/kafka_2.12-2.4.1/bin/kafka-server-stop.sh' done
};;esac