Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!
Labels (1)
avatar

Often the namenode log files grow in size and they have too many kinds of messages. One of the most commonly faced scenario is where there had been multiple state changes in hdfs and investigating them becomes a pain when there are multiple occurrence in huge log files.

Luckily there is a very easy way to make a few configuration changes to ensure that state change log statements get logged to a separate file.

To isolate and log state change log messages to another file, add the following to hdfs-log4j and restart the namenodes.

You can make this change from Ambari.


Ambari > HDFS service > Configs tab > Advanced tab > Advanced hdfs-log4j section > hdfs-log4j template

# StateChange log 
log4j.logger.org.apache.hadoop.hdfs.StateChange=INFO,SCL 
log4j.additivity.org.apache.hadoop.hdfs.StateChange=false 
log4j.appender.SCL=org.apache.log4j.RollingFileAppender 
log4j.appender.SCL.File=${hadoop.log.dir}/hdfs-state-change.log 
log4j.appender.SCL.MaxFileSize=256MB 
log4j.appender.SCL.MaxBackupIndex=20 
log4j.appender.SCL.layout=org.apache.log4j.PatternLayout 
log4j.appender.SCL.layout.ConversionPattern=%d{ISO8601} %-5p %c{2} (%F:%M(%L)) - %m%n 

In this way, HDFS StateChange log messages will be written in ${hadoop.log.dir}/hdfs-state-change.log
1,809 Views
Version history
Last update:
‎09-14-2017 04:04 AM
Updated by:
Contributors