cdh 日志清理

Last updated on November 20, 2024 am

🧙 Questions

☄️ Ideas

临时清理cdh日志

vim clean_cdh_log.sh
#!/bin/bash

# cloudera manager monitor log
rm -rf /var/lib/cloudera-host-monitor/ts/*/partition*/* 
rm -rf /var/lib/cloudera-service-monitor/ts/*/partition*/* 

# cloudera
rm -rf /var/log/cloudera-scm-server/*.log.*
rm -rf /var/log/cloudera-scm-agent/*.log.*
rm -rf /var/log/cloudera-scm-firehose/*.out.*
rm -rf /var/log/cloudera-scm-eventserver/*.out.*

# httpfs
rm -rf /var/log/hadoop-httpfs/*.log.*

# yarn
rm -rf /var/log/hadoop-yarn/*.out.*
rm -rf /var/log/hadoop-yarn/*.audit.*

# hdfs
rm -rf /var/log/hadoop-hdfs/*.log.*

# mapreduce
rm -rf /var/log/hadoop-mapreduce/*.log.*

# zookeeper
rm -rf /var/log/zookeeper/*.log.*

执行清理脚本

bash clean_cdh_log.sh

映射cdh日志路径

需要先停止CDH集群!!!


# 将日志转移
sudo mv /var/log/zookeeper /data/cdh/log/ 
sudo mv /var/log/hadoop-hdfs /data/cdh/log/
sudo mv /var/log/hadoop-yarn /data/cdh/log/ 
sudo mv /var/log/hive /data/cdh/log/

# 添加软件链接
sudo ln -s /data/cdh/log/zookeeper /var/log/zookeeper
sudo ln -s /data/cdh/log/hadoop-hdfs /var/log/hadoop-hdfs
sudo ln -s /data/cdh/log/hadoop-yarn /var/log/hadoop-yarn
sudo ln -s /data/cdh/log/hive /var/log/hive

然后启动CDH


cdh 日志清理
https://ispong.isxcode.com/hadoop/cloudera/cdh 日志清理/
Author
ispong
Posted on
September 28, 2021
Licensed under