#!/bin/bash
#配置ES的安装目录 修改的地方1 脚本可以自己创建
zkServers='node1 node2 node3'
zkPath="/soft/bigdata/zookeeper-3.4.9/bin/zkServer.sh"
#启动所有的zk
case $1 in
"start"){
for i in $zkServers
do
echo ============$i===============
ssh $i "$zkPath start"
echo 从节点 $i 启动zk...[ done ]
done
};;
"stop"){
for i in $zkServers
do
echo ============$i===============
ssh $i "$zkPath stop"
echo 从节点 $i 停止zk...[ done ]
done
};;
"status"){
for i in $zkServers
do
echo ============$i===============
ssh $i "$zkPath status"
done
};;
esac