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 (2)
avatar
Master Mentor

The below steps describe how to change the Namenode log level while logged on as hdfs with the below steps, without the need to restart the namenode

Get the current log level

$ hadoop daemonlog -getlevel {namenode_host}:50070BlockStateChange

Desired Output

Connecting to http://{namenode_host}:50070/logLevel?log=BlockStateChange 
SubmittedLogName:BlockStateChange
LogClass: org.apache.commons.logging.impl.Log4J
LoggerEffectiveLevel: INFO

Change to DEBUG

$ hadoop daemonlog -setlevel {namenode_host}:50070BlockStateChange DEBUG 

Desired Output

Connecting to http://{namenode_host}:50070/logLevel?log=BlockStateChange&level=DEBUG 
SubmittedLogName:BlockStateChange
LogClass: org.apache.commons.logging.impl.Log4J
LoggerSubmittedLevel: DEBUG 
SettingLevel to DEBUG ...
EffectiveLevel: DEBUG

Validate DEBUG mode

$ hadoop daemonlog -getlevel {namenode_host}:50070BlockStateChange

Desired Output

Connecting to http://{namenode_host}:50070/logLevel?log=BlockStateChange 
SubmittedLogName:BlockStateChange
LogClass: org.apache.commons.logging.impl.Log4J
LoggerEffectiveLevel: DEBUG

You should be able to notice the logging level in namenode.log has been updated, without restarting the service. After finishing your diagnostics you can reset the logging level back to INFO

Reset to INFO

$ hadoop daemonlog -setlevel {namenode_host}:50070BlockStateChange INFO 

Desired Output

Connecting to http://{namenode_host}:50070/logLevel?log=BlockStateChange&level=INFO 
SubmittedLogName:BlockStateChange
LogClass: org.apache.commons.logging.impl.Log4J
LoggerSubmittedLevel: INFO 
SettingLevel to INFO ...
EffectiveLevel: INFO 

Validate INFO

$ hadoop daemonlog -getlevel {namenode_host}:50070BlockStateChange

Output

Connecting to http://{namenode_host}:50070/logLevel?log=BlockStateChange 
SubmittedLogName:BlockStateChange
LogClass: org.apache.commons.logging.impl.Log4J
LoggerEffectiveLevel: INFO

Happy hadooping !!!!

3,113 Views
0 Kudos
Version history
Last update:
‎02-08-2019 02:58 PM
Updated by:
Contributors