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