Flume定时启动任务 防止挂掉


一,查看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

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM