Zookeeper实现脚本集群启动

注意目录替换

#!/bin/bash
#参数传递
usage="Usage: $0 (start|stop|status)"
if [ $# -lt 1 ]; then
  echo $usage
  exit 1
fi
behave=$1
echo "$behave zkServer cluster"
#主机名称
for i in 01 02 03
do
#使用ssh进行启动
ssh zk$i "apps/apache-zookeeper-3.6.0-bin/bin/zkServer.sh $behave"
done
exit 0
原创文章 280 获赞 464 访问量 10万+

猜你喜欢

转载自blog.csdn.net/qq_33709508/article/details/105612314
今日推荐