不知道用ssh命令启动不了zookeeper集群所以我干脆改用两个脚本启动zookeeper
在此处使用启动脚本a启动zookeeper的启动脚本b

#!/bin/sh
for host in hadoop01 hadoop02 hadoop03
do
ssh $host "source /etc/profile; sh /root/xcall1.sh"
done

此处是zookeeper的启动脚本的启动脚本b

#!/bin/sh
for host in hadoop01 hadoop02 hadoop03
do
/export/servers/zookeeper-3.4.14/bin/zkServer.sh start
/export/servers/zookeeper-3.4.14/bin/zkServer.sh status


done

ssh启动zookeeper失败的集群修改后的启动脚本_启动脚本