大叔经验分享(75)常用组件日志清理
包括cloudera-manager、hdfs、impala、kudu、oozie以及系统日志等;
#cloudera-service-monitor log /bin/rm /var/lib/cloudera-service-monitor/ts/*/partition*/* -rf /bin/rm /var/lib/cloudera-host-monitor/ts/*/partition*/* -rf #hdfs log /bin/rm /var/log/hadoop-hdfs/*.out.* /bin/rm /var/log/hadoop-hdfs/hdfs-audit.log.* #impala log num=`ls /var/log/impalad/|grep 'impala.log.INFO'|wc -l` ls /var/log/impalad/|grep 'impala.log.INFO'|sed $num'd'|xargs -i /bin/rm /var/log/impalad/{} num=`ls /var/log/impalad/|grep 'impala.log.WARNING'|wc -l` ls /var/log/impalad/|grep 'impala.log.WARNING'|sed $num'd'|xargs -i /bin/rm /var/log/impalad/{} num=`ls /var/log/impalad/|grep 'impala.log.ERROR'|wc -l` ls /var/log/impalad/|grep 'impala.log.ERROR'|sed $num'd'|xargs -i /bin/rm /var/log/impalad/{} num=`ls /var/log/impalad/profiles/|wc -l` ls /var/log/impalad/profiles/|sed $num'd'|xargs -i /bin/rm /var/log/impalad/profiles/{} #kudu log num=`ls /var/log/kudu/|grep 'log.INFO'|wc -l` ls /var/log/kudu/|grep 'log.INFO'|sed $num'd'|xargs -i /bin/rm /var/log/kudu/{} num=`ls /var/log/kudu/|grep 'log.ERROR'|wc -l` ls /var/log/kudu/|grep 'log.ERROR'|sed $num'd'|xargs -i /bin/rm /var/log/kudu/{} num=`ls /var/log/kudu/|grep 'log.FATAL'|wc -l` ls /var/log/kudu/|grep 'log.FATAL'|sed $num'd'|xargs -i /bin/rm /var/log/kudu/{} num=`ls /var/log/kudu/|grep 'log.WARNING'|wc -l` ls /var/log/kudu/|grep 'log.WARNING'|sed $num'd'|xargs -i /bin/rm /var/log/kudu/{}
/bin/rm /var/log/kudu/*.gz #oozie log num=`ls /var/log/oozie/|grep 'log.out-'|wc -l` ls /var/log/oozie/|grep 'log.out-'|sed $num'd'|xargs -i /bin/rm /var/log/oozie/{} /bin/rm /var/log/oozie/oozie-instrumentation.log.* #system journal /bin/rm /var/log/journal/*/system@00000000000000000000000000000000-*.journal /bin/rm -rf /var/log/messages-*
---------------------------------------------------------------- 结束啦,我是大魔王先生的分割线 :) ----------------------------------------------------------------
- 由于大魔王先生能力有限,文中可能存在错误,欢迎指正、补充!
- 感谢您的阅读,如果文章对您有用,那么请为大魔王先生轻轻点个赞,ありがとう