一,查看Flume条数:ps -ef|grep java|grep flume|wc -l       ==》15

检查进程:给sh脚本添加权限,chmod 777 xx.sh

#!/bin/sh
is_Engine_exist=$(ps -ef|grep java|grep flume|wc -l)
 
if [ $is_Engine_exist -ne 15 ];then
 
        echo 'flumeis down' 
       
cd /usr/hadoop/flume/flume-server
        nohup bin/flume-ng agent -c conf/ -f /usr/hadoop/flume/spooldircsv1.conf -n a1 -Dflume.root.logger=WARN,console >>./local/run.log 2>&1 &
 
else
 
        strDate=`date +%Y%m%d%H%M%S`
 
        strRun="running ${strDate}"
 
fi

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-28
  • 2021-11-12
  • 2022-12-23
  • 2021-04-07
  • 2021-06-14
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-13
  • 2021-08-23
  • 2021-11-18
  • 2021-08-24
  • 2021-09-25
相关资源
相似解决方案