Heidi Qiao
Heidi Qiao

Reputation: 63

how to clean the hadoop-hdfs logs under /var/log/hadoop-hdfs

my name node in the hadoop cluster turned to bad health because "The role's log directory is non a file system with less than 4GB of its space free. /var/log/hadoop-hdfs (free: 2.4GB (11.12%), capacity:21.7 GB"

I looked into that folder and found that I have 5.5GB of log files called "hdfs-audit.log.0" -"hdfs-audit.log.20" in it. I read these files and I really don't need to save these logs. I am wondering is there a way to permanently delete them and never generate them again? ( I tried to delete them manually, but it seems that they came back after a few hours.)

I also tried to add "log4j.logger.org.apache.hadoop.hdfs.server.namenode.FSNamesystem.audit=WARN,NullAppender" in my /etc/hadoop/conf/log4j.properties. But it did not prevent those files from "coming back".

Thank you for your help in advance!

Upvotes: 6

Views: 17201

Answers (1)

Pixou
Pixou

Reputation: 1769

First of all, Hadoop is designed for much larger capacity than the ones you mention, which means that 5.5GB logs aren't that much usually. This explains why the default settings is not appropriate in your case.

You can:

  • reduce the number of log files that are retained with the variable navigator.audit_log_max_backup_index (usually 10)
  • or the max log file size with navigator.audit_log_max_file_size

Upvotes: 4

Related Questions