1.新建start-sh.sh文件
vi start-ha.sh
#!/bin/bash
echo "-----------正在启动zookeeper-----"
for hostname in mini1 mini2 mini3
do
ssh $hostname "source /etc/profile;/home/hadoop/apps/zookeeper/zookeeper-3.4.10/bin/zkServer.sh start"
echo "$hostname zk is running"
done
for hostname in mini1 mini2 mini3
do
ssh $hostname "source /etc/pro