start_zk.sh
#!/bin/sh
for host in node-1 node-2 node-3
do
ssh $host "source /etc/profile;zkServer.sh start"
echo "$host zk is running"
done
stop_zk.sh
#!/bin/sh
for host in node-1 node-2 node-3
do
ssh $host "source /etc/profile;zkServer.sh stop"
echo "$host zk is stopping"
done
status_zk.sh
#!/bin/sh
for host in node-1 node-2 node-3
do
ssh $host "source /etc/profile;zkServer.sh status"
echo "$host zk's status"
done
网友评论