更新时间:2024-06-14 GMT+08:00
分享

查看HBase应用调测结果

操作场景

HBase应用程序运行完成后,可直接通过运行结果查看应用程序运行情况,也可以通过HBase日志获取应用运行情况。

操作步骤

  • 运行结果会有如下成功信息:
    ...
    2020-01-09 10:43:49,338 INFO  [main] examples.HBaseExample: Entering dropTable.
    2020-01-09 10:43:49,341 INFO  [main] client.HBaseAdmin: Started disable of hbase_sample_table
    2020-01-09 10:43:50,080 INFO  [main] client.HBaseAdmin: Operation: DISABLE, Table Name: default:hbase_sample_table, procId: 41 completed
    2020-01-09 10:43:50,550 INFO  [main] client.HBaseAdmin: Operation: DELETE, Table Name: default:hbase_sample_table, procId: 43 completed
    2020-01-09 10:43:50,550 INFO  [main] examples.HBaseExample: Drop table successfully.
    2020-01-09 10:43:50,550 INFO  [main] examples.HBaseExample: Exiting dropTable.
    2020-01-09 10:43:50,550 INFO  [main] client.ConnectionImplementation: Closing master protocol: MasterService
    2020-01-09 10:43:50,556 INFO  [main] examples.TestMain: -----------finish to test HBase API------------------- 

    在Windows环境运行样例代码时会出现下面的异常,但是不影响业务:

    java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.

  • 日志说明

    日志级别默认为INFO,可以通过调整日志打印级别(DEBUG,INFO,WARN,ERROR,FATAL)来显示更详细的信息。可以通过修改log4j.properties文件来实现,如:

    hbase.root.logger=INFO,console
    log4j.logger.org.apache.zookeeper=INFO
    #log4j.logger.org.apache.hadoop.fs.FSNamesystem=DEBUG
    log4j.logger.org.apache.hadoop.hbase=INFO
    # Make these two classes DEBUG-level. Make them DEBUG to see more zk debug.
    log4j.logger.org.apache.hadoop.hbase.zookeeper.ZKUtil=INFO
    log4j.logger.org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher=INFO

相关文档