阅读背景:

如何静音apache zookeeper调试消息(AWS EMR)?

来源:互联网 

How to mute DEBUG messages on AWS Elastic MapReduce Master node?

如何在AWS弹性MapReduce主节点上屏蔽调试消息?

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

2 个解决方案

#1


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:

我不知道Web UI中是否有一些选项可以改变日志冗长性。但是必须有一个Zookeeper(使用Log4j)配置文件夹${ZOOKEEPER_HOME}/conf,在这里可以编辑文件logj4。属性和指定:

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:

但是我认为这些更改必须不在Zookeeper中直接执行,而是在HBase日志配置中——${HBASE_HOME}/conf (HBase也使用Log4j),因为HBase可以管理Zookeeper。这里可以编辑的参数很少:

# 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

#2


0  

Accepted answer for this question helps to suppress debug log messages not only for the hbase shell but for all other hbase running daemons (e.g. region server, zookeeper). All you need is to add:

对于这个问题的公认答案不仅有助于抑制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>

into ~/hbase/conf/logback.xml and restart all services or hbase shell.

到~ / hbase / conf / logback。xml并重新启动所有服务或hbase shell。


分享到: