zookeeper shell 启动/状态/停止 脚本

 

启动zookeeper集群

#!/bin/sh
# zookeeper 集群启动shell脚本命令

echo "---------------------------------------------------------------------------"
echo "zookeeper start 172.16.1.8/9/10"

echo "...master-start..."
ssh master "source /etc/profile;zkServer.sh start"
echo "...slave1-start..."
ssh slave1 "source /etc/profile;zkServer.sh start"
echo "...slave2-start..."
ssh slave2 "source /etc/profile;zkServer.sh start"
echo "...all-start-end..."

echo "---------------------------------------------------------------------------"

查看zookeeper集群

#!/bin/sh
# zookeeper 集群状态shell脚本命令

echo "---------------------------------------------------------------------------"
echo "zookeeper status 172.16.1.8/9/10"

echo "...master-status..."
ssh master "source /etc/profile;zkServer.sh status"
echo "...slave1-status..."
ssh slave1 "source /etc/profile;zkServer.sh status"
echo "...slave2-status..."
ssh slave2 "source /etc/profile;zkServer.sh status"

echo "---------------------------------------------------------------------------"

停止zookeeper集群

#!/bin/sh
# zookeeper 集群停止shell脚本命令

echo "---------------------------------------------------------------------------"
echo "zookeeper start 172.16.1.8/9/10"

echo "...master-stop..."
ssh master "source /etc/profile;zkServer.sh stop"
echo "...slave1-stop..."
ssh slave1 "source /etc/profile;zkServer.sh stop"
echo "...slave2-stop..."
ssh slave2 "source /etc/profile;zkServer.sh stop"
echo "...all-stop-end..."

echo "---------------------------------------------------------------------------"

修改文件权限

chmod 755 ./*

chmod 755 zkStartCluster.sh  
chmod 755 zkStatusCluster.sh  
chmod 755 zkStopCluster.sh 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值