Options
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Master Mentor
Created on 02-08-2019 02:58 PM
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 !!!!