#! /bin/sh
for host in hadoop101 hadoop102 hadoop103
do
ssh $host "source /etc/profile;nohup /opt/module/kafka/bin/kafka-server-start.sh /opt/module/kafka/config/server.properties >/dev/null 2>&1 &"
echo "$host kafka is running"
done
vim stop-kafka.sh
#! /bin/sh
for host in hadoop101 hadoop102 hadoop103
do
ssh $host "source /etc/profile; /opt/module/kafka/bin/kafka-server-stop.sh"
echo "$host kafka is stopping"
done