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