storm集群一键关闭shell脚本

2 篇文章 0 订阅
2 篇文章 0 订阅

!/bin/bash

for host in node-1 node-2 node-3

do

ssh $host “source /etc/profile;”

ip= (ssh ( s s h host ifconfig eth0|grep “inet addr:”|awk -F”:” ‘{print 2}'|awk '{print 2}'|awk '{print 1}’)

pid1= (ssh ( s s h host ps ax | grep -i ‘core’ | grep java | grep -v grep | awk ‘{print 1}’)  
pid2=
1}’)  pid2=
(ssh hostpsax|grepinimbus|grepjava|grepvgrep|awkprint$1)pid3= h o s t p s a x | g r e p − i ‘ n i m b u s ′ | g r e p j a v a | g r e p − v g r e p | a w k ‘ p r i n t $ 1 ′ ) p i d 3 = (ssh host ps ax | grep -i ‘supervisor’ | grep java | grep -v grep | awk ‘{print host ps ax | grep -i ‘supervisor’ | grep java | grep -v grep | awk ‘{print 1}’)i

if [ -z “ pid1];thenecho p i d 1 ” ] ; t h e n e c h o “ ip storm ui is not runnning”
else
ssh hostkill9 h o s t k i l l − 9 pid1
echo “$ip storm ui is stopping”
fi

if [ -z “ pid2];thenecho p i d 2 ” ] ; t h e n e c h o “ ip storm nimbus is not runnning”
else
ssh hostkill9 h o s t k i l l − 9 pid2
echo “$ip storm nimbus is stopping”
fi

if [ -z “ pid3];thenecho p i d 3 ” ] ; t h e n e c h o “ ip storm supervisor is not runnning”
else
ssh hostkill9 h o s t k i l l − 9 pid3
echo “$ip storm supervisor is stopping”
fi

done

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值