当先锋百科网

首页 1 2 3 4 5 6 7
#!/bin/bash

case $1 in
"start")
    for i in hadoop102 hadoop103 hadoop104
    do
        echo "---启动 $i kafka---"
        ssh $i "/opt/module/kafka/bin/kafka-server-start.sh -daemon /opt/module/kafka/config/server.properties"
    done
;;
"stop")
    for i in hadoop102 hadoop103 hadoop104
    do
        echo "---停止 $i kafka---"
        ssh $i "/opt/module/kafka/bin/kafka-server-stop.sh"
    done
;;
esac