#!/bin/bashcase $1 in"start"){ for i in bigdata101 bigdata102 bigdata103 do echo "------------- $i -------------" ssh $i "/opt/apps/zookeeper/bin/zkServer.sh start" done};;"stop"){ for i in bigdata101 bigdata102 bigdata103 do echo "------------- $i -------------" ssh $i "/opt/apps/zookeeper/bin/zkServer.sh stop" done};;"status"){ for i in bigdata101 bigdata102 bigdata103 do echo "------------- $i -------------" ssh $i "/opt/apps/zookeeper/bin/zkServer.sh status" done};;esac
#! /bin/bashcase $1 in"start"){ for i in bigdata101 bigdata102 bigdata103 do echo " --------启动 $i Kafka-------" ssh $i "/opt/apps/kafka/bin/kafka-server-start.sh -daemon /opt/apps/kafka/config/server.properties " done};;"stop"){ for i in bigdata101 bigdata102 bigdata103 do echo " --------停止 $i Kafka-------" ssh $i "/opt/apps/kafka/bin/kafka-server-stop.sh stop" done};;esac