如何在AWS Elastic MapReduce主节点上静音DEBUG消息?
hbase(main):003:0> list
TABLE
mydb
1 row(s) in 0.0510 seconds
hbase(main):004:0> 00:25:17.104 [main-SendThread(ip-172-31-14-206.ec2.internal:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x1493a5c3b78001b after 1ms
hbase(main):005:0* 00:26:17.165 [main-SendThread(ip-172-31-14-206.ec2.internal:2181)] DEBUG org.apache.zookeeper.ClientCnxn - Got ping response for sessionid: 0x1493a5c3b78001b after 1ms
答案 0 :(得分:0)
I don't know if there is some option in Web UI to change log verbosity. But there must be a Zookeeper (which is using Log4j) configuration folder ${ZOOKEEPER_HOME}/conf where you can edit file logj4.properties and specify:
zookeeper.console.threshold=WARN
But I think that those changes must be done not directly in Zookeeper, but in HBase log configuration -${HBASE_HOME}/conf (HBase also use Log4j), because HBase can manage Zookeeper. There are few parameters that can be edited there:
# Define some default values that can be overridden by system properties
hbase.root.logger=INFO,console
hbase.security.logger=INFO,console
# Main log level
log4j.threshold=ALL
# Zookeeper log level
log4j.logger.org.apache.zookeeper=INFO
To find this file you can try next command:
$ find /* -name "log4j.properties" | grep -E "zookeeper|hbase"
/hadoop/zookeeper/conf/log4j.properties
/hadoop/hbase/conf/log4j.properties
答案 1 :(得分:0)
this question的已接受答案有助于抑制调试日志消息,不仅针对hbase shell
,还针对所有其他运行hbase的守护程序(例如,区域服务器,zookeeper)。您只需要添加:
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<root level="error">
<appender-ref ref="STDOUT" />
</root>
</configuration>
进入~/hbase/conf/logback.xml
并重新启动所有服务或hbase shell。