Community Articles
Find and share helpful community-sourced technical articles
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.
Labels (2)
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 !!!!

276 Views
0 Kudos
Don't have an account?
Coming from Hortonworks? Activate your account here
Version history
Revision #:
1 of 1
Last update:
‎02-08-2019 02:58 PM
Updated by:
 
Contributors
Top Kudoed Authors