Apache-flume Restart the script, Apache-flume Restart the regular start of multiple processes, kill not clean, write a restart script.
#echo-e parameter output is red, online can search the shell output with color font encoding a lot.
Cat obi-track_restart.sh #!/bin/bashpid= ' lsof -i:8787 | grep java | awk ' {print $2} ' if [ -n ' ${pid} ' ];thenecho -e ' ############\033[31m kill ${pid} \033[0m############# "for i in " ${pid} "doecho $ikill -9 "${i}" sleep 5 check_pid= ' lsof -i:8787 | grep java | awk ' {print $2} ' if [ -z ' ${check_pid} ' ]; thenecho -e "############\033[31m flume has been killed, is starting \033[0m#############" elsekill -9 ${check_pid}fidonenohup /data/apache-flume-1.6.0-bin/bin/flume-ng agent -c /data/ apache-flume-1.6.0-bin/conf/ -f /data/env/obi/obi-track/track_conf.properties -n a1 - dflume.root.logger=info,console > /data/apache-flume-1.6.0-bin/flume.log 2>&1 &echo -e "##############\033[31m boot complete \033[0m############### "Elsenohup /data/apache-flume-1.6.0-bin/bin/flume-ng agent -c /data/apache-flume-1.6.0-bin/conf/ -f /data/env/obi/obi-track/track_ conf.properties -n a1 -dflume.root.logger=info,console > /data/ apache-flume-1.6.0-bin/flume.log 2>&1 &echo -e "##############\033[31m Start complete \033[0m############### "fi
This article is from the "LINUX Super Dream" blog, make sure to keep this source http://215687833.blog.51cto.com/6724358/1888556
Apache-flume Restart Script