zoukankan      html  css  js  c++  java
  • 【原创】大叔经验分享(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-*
  • 相关阅读:
    第九篇 python基础之函数,递归,内置函数
    第六篇:python基础之文件处理
    第五篇:python基础之字符编码
    第四篇:python基础之条件和循环
    第三篇:python基础之数据类型与变量
    第二篇:python基础之核心风格
    第一篇:初识Python
    作业
    作业3
    作业2
  • 原文地址:https://www.cnblogs.com/barneywill/p/11127383.html
Copyright © 2011-2022 走看看