1.在每台机子上部署supervisor-hosts
# cat supervisor-hosts
yun01
yun03
yun02
在运行关机的机子上运行脚本的时候,此时的supervisor-hosts 排序书序就得注意了 ,排在最后才比较安全
直接运行脚本即可,前提确保有可执行权限
############# myOwnShutdown.sh used for shutdown all ssh computer
#!/bin/bash. /etc/profile
bin=/root
supervisors=/root/supervisor-hosts
cat $supervisors | while read supervisor
do
echo $supervisor
ssh $supervisor init 0 &
done