• HBase无法连接ZooKeeper问题


    上次搭建HBase环境后,运行登陆server时,报以下的错误:

    hadoop@gpmaster logs]$ hbase shell

    SLF4J: Class path contains multiple SLF4J bindings.
    SLF4J: Found binding in [jar:file:/home/hadoop/hbase-1.0.1.1/lib/slf4j-log4j12-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: Found binding in [jar:file:/home/hadoop/hadoop-2.6.0/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
    SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
    2015-06-13 17:27:40,516 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
    HBase Shell; enter 'help<RETURN>' for list of supported commands.
    Type "exit<RETURN>" to leave the HBase Shell
    Version 1.0.1.1, re1dbf4df30d214fca14908df71d038081577ea46, Sun May 17 12:34:26 PDT 2015


    hbase(main):001:0> status
    ERROR: org.apache.hadoop.hbase.PleaseHoldException: Master is initializing
    at org.apache.hadoop.hbase.master.HMaster.checkInitialized(HMaster.java:1875)
    at org.apache.hadoop.hbase.master.MasterRpcServices.getClusterStatus(MasterRpcServices.java:691)
    at org.apache.hadoop.hbase.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java:42406)
    at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2031)
    at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:107)
    at org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:130)
    at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:107)
    at java.lang.Thread.run(Thread.java:745)

    Here is some help for this command:
    Show cluster status. Can be 'summary', 'simple', 'detailed', or 'replication'. The
    default is 'summary'. Examples:
      hbase> status
      hbase> status 'simple'
      hbase> status 'summary'
      hbase> status 'detailed'
      hbase> status 'replication'
      hbase> status 'replication', 'source'
      hbase> status 'replication', 'sink'

    hbase(main):002:0> 


    经查看日志/home/hadoop/hbase-1.0.1.1/logs/hbase-hadoop-regionserver-gpmaster.log后,

    发现关键错误信息:
    client.HConnectionManager$HConnectionImplementation: Can''t get connection to ZooKeeper: KeeperErrorCode = ConnectionLoss for /hbase。


    依据信息能够推断zk无法连接。

    运行jps查看zk都正常。查看hbase-site.xml中zk节点配置正常。依据经验,应该是防火墙没有关闭,2181port无法訪问。
    运行service iptables stop关闭防火墙,重新启动hbase。进入hbase shell,运行list:


    hbase(main):001:0> list
    TABLE
    SLF4J: Class path contains multiple SLF4J bindings.
    SLF4J: Found binding in [jar:file:/root/hadoop/hbase/lib/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: Found binding in [jar:file:/root/hadoop/hadoop-2.2.0/share/hadoop/common/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
    2014-07-17 14:06:26,013 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

    0 row(s) in 1.0070 seconds

    => []


    这样就一切正常了。

  • 相关阅读:
    Day 13 匿名函数 :内置函数: 闭包
    Day 12 生成器:生成器表达式:列表表达式:yield:yield from:内置函数
    最近这些天
    正则表达式 I
    Python 软件规范开发
    模块
    常用模块介绍 time datetime os sys hashlib json pickle collections
    模拟博客园登录 基础版
    SQL 必知必会
    Python中的线程和进程
  • 原文地址:https://www.cnblogs.com/blfbuaa/p/6865881.html
Copyright © 2020-2023  润新知