zookeeper集群脚本
1、一键启动zookeeper集群
2、一键查看zookeeper集群状态
3、一键停止zookeeper集群
1、一键启动zookeeper集群
echo "start zkServer..."
for i in master server01 server02
do
echo "start zk"+$i+"启动中..."
ssh $i "source /etc/profile;/home/zzz/modules/zookeeper-3.4.7/bin/zkServer.sh start"
done
2、一键查看zookeeper集群状态
echo "status zkServer..."
for i in master server01 server02
do
echo "status zk"+$i+"现在的状态..."
ssh $i "source /etc/profile;/home/zzz/modules/zookeeper-3.4.7/bin/zkServer.sh status"
done
3、一键停止zookeeper集群
echo "stop zkServer..."
for i in master server01 server02
do
echo "stop zk"+$i+"停止中..."
ssh $i "source /etc/profile;/home/zzz/modules/zookeeper-3.4.7/bin/zkServer.sh stop"
done