1
#!/bin/bash
export FLUME_HOME=/opt/apps/flume-1.9.0
while true
do
pc=`ps -ef | grep flume | grep -v "grep" | wc -l`
if [[ $pc -lt 1 ]]
then
echo "detected no flume process.... preparing to launch flume agent...... "
${FLUME_HOME}/bin/flume-ng agent -n a1 -c ${FLUME_HOME}/conf/ -f ${FLUME_HOME}/agentconf/failover.properties 1>/dev/null 2>&1 &
else
echo "detected flume process number is : $pc "
fi
sleep 1
done