It would sometimes be useful to adjust the log level when executing hbase client commands from command line without having to restart components. This article explains how that can be achieved:
You can set DEBUG level for any client hbase command by exporting the following environment variable before it is executed:
HBASE_ROOT_LOGGER=hbase.root.logger=DEBUG,console
For example:
# export HBASE_ROOT_LOGGER=hbase.root.logger=DEBUG,console
# hbase hbck
2016-12-24 15:18:03,240 DEBUG [main] util.Shell: setsid exited with exit code 0
2016-12-24 15:18:03,363 DEBUG [main] lib.MutableMetricsFactory: field org.apache.hadoop.metrics2.lib.MutableRate org.apache.hadoop.security.UserGroupInformation$UgiMetrics.loginSuccess with annotation @org.apache.hadoop.metrics2.annotation.Metric(always=false, about=, sampleName=Ops, type=DEFAULT, value=[Rate of successful kerberos logins and latency (milliseconds)], valueName=Time)
2016-12-24 15:18:03,373 DEBUG [main] lib.MutableMetricsFactory: field org.apache.hadoop.metrics2.lib.MutableRate org.apache.hadoop.security.UserGroupInformation$UgiMetrics.loginFailure with annotation @org.apache.hadoop.metrics2.annotation.Metric(always=false, about=, sampleName=Ops, type=DEFAULT, value=[Rate of failed kerberos logins and latency (milliseconds)], valueName=Time)
2016-12-24 15:18:03,373 DEBUG [main] lib.MutableMetricsFactory: field org.apache.hadoop.metrics2.lib.MutableRate org.apache.hadoop.security.UserGroupInformation$UgiMetrics.getGroups with annotation @org.apache.hadoop.metrics2.annotation.Metric(always=false, about=, sampleName=Ops, type=DEFAULT, value=[GetGroups], valueName=Time)
2016-12-24 15:18:03,375 DEBUG [main] impl.MetricsSystemImpl: UgiMetrics, User and group related metrics
2016-12-24 15:18:03,407 DEBUG [main] security.SecurityUtil: Setting hadoop.security.token.service.use_ip to true
2016-12-24 15:18:03,443 DEBUG [main] security.Groups: Creating new Groups object
2016-12-24 15:18:03,447 DEBUG [main] util.NativeCodeLoader: Trying to load the custom-built native-hadoop library...
2016-12-24 15:18:03,447 DEBUG [main] util.NativeCodeLoader: Loaded the native-hadoop library
2016-12-24 15:18:03,452 DEBUG [main] security.JniBasedUnixGroupsMapping: Using JniBasedUnixGroupsMapping for Group resolution
2016-12-24 15:18:03,452 DEBUG [main] security.JniBasedUnixGroupsMappingWithFallback: Group mapping impl=org.apache.hadoop.security.JniBasedUnixGroupsMapping
2016-12-24 15:18:03,542 DEBUG [main] security.Groups: Group mapping impl=org.apache.hadoop.security.JniBasedUnixGroupsMappingWithFallback; cacheTimeout=300000; warningDeltaMs=5000
2016-12-24 15:18:03,644 DEBUG [main] security.UserGroupInformation: hadoop login
2016-12-24 15:18:03,647 DEBUG [main] security.UserGroupInformation: hadoop login commit
2016-12-24 15:18:03,649 DEBUG [main] security.UserGroupInformation: using kerberos user:hbase/dghdp253.openstacklocal@HWX.COM
2016-12-24 15:18:03,649 DEBUG [main] security.UserGroupInformation: Using user: "hbase/dghdp253.openstacklocal@HWX.COM" with name hbase/dghdp253.openstacklocal@HWX.COM
2016-12-24 15:18:03,650 DEBUG [main] security.UserGroupInformation: User entry: "hbase/dghdp253.openstacklocal@HWX.COM"
2016-12-24 15:18:03,653 DEBUG [main] security.UserGroupInformation: UGI loginUser:hbase/dghdp253.openstacklocal@HWX.COM (auth:KERBEROS)
<snip>
Note, the following log levels are supported: ALL DEBUG ERROR FATAL INFO OFF TRACE TRACE_INT WARN