一,查看Flume条数:ps -ef|grep java|grep flume|wc -l ==》15
检查进程:给sh脚本添加权限,chmod 777 xx.sh
1
2
3
4
5
6
#!/bin/sh
is_Engine_exist=$(ps -ef|grep java|grep flume|wc -l)
if [ $is_Engine_exist -ne 15 ];then
echo 'flumeis down' <br> <br> cd /usr/hadoop/flume/flume-server
1
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 &
1
2
3
4
5
6
7
8
9
<em id="__mceDel">
else
strDate=`date +%Y%m%d%H%M%S`
strRun="running ${strDate}"
fi
</em>