为啥 Impala 不能在 hbase 表上工作?

Posted

技术标签:

【中文标题】为啥 Impala 不能在 hbase 表上工作?【英文标题】:Why Impala not working on hbase table?为什么 Impala 不能在 hbase 表上工作? 【发布时间】:2015-07-20 08:49:04 【问题描述】:

我使用 hive 创建了 hbase 表 A 的外部表 B。我可以成功访问B的数据。然后我按照官方指南输入Imapla Shell:

invalidate metadata B;

然后我在 Impala Shell 中查询这个外部表 B:

select * from B limit 4;

但它输出:

ERROR: RuntimeException: couldn't retrieve HBase table (mv_p2pusers) info:
Enable/Disable failed

以下是一些相关的日志:

11:13:58.937 AM INFO    jni-util.cc:177 
java.lang.RuntimeException: couldn't retrieve HBase table (mv_p2pusers) info:
Enable/Disable failed
    at com.cloudera.impala.planner.HBaseScanNode.computeScanRangeLocations(HBaseScanNode.java:300)
    at com.cloudera.impala.planner.HBaseScanNode.init(HBaseScanNode.java:125)
    at com.cloudera.impala.planner.SingleNodePlanner.createScanNode(SingleNodePlanner.java:891)
    at com.cloudera.impala.planner.SingleNodePlanner.createTableRefNode(SingleNodePlanner.java:1082)
    at com.cloudera.impala.planner.SingleNodePlanner.createSelectPlan(SingleNodePlanner.java:526)
    at com.cloudera.impala.planner.SingleNodePlanner.createQueryPlan(SingleNodePlanner.java:151)
    at com.cloudera.impala.planner.SingleNodePlanner.createSingleNodePlan(SingleNodePlanner.java:117)
    at com.cloudera.impala.planner.Planner.createPlan(Planner.java:47)
    at com.cloudera.impala.service.Frontend.createExecRequest(Frontend.java:842)
    at com.cloudera.impala.service.JniFrontend.createExecRequest(JniFrontend.java:146)
11:13:58.939 AM INFO    status.cc:114   
RuntimeException: couldn't retrieve HBase table (mv_p2pusers) info:
Enable/Disable failed
    @           0x78b793  (unknown)
    @           0xa68275  (unknown)
    @           0x9802c6  (unknown)
    @           0x99db78  (unknown)
    @           0x99e6e4  (unknown)
    @           0x9d50cb  (unknown)
    @           0xb33687  (unknown)
    @           0xb29054  (unknown)
    @           0x9ac52b  (unknown)
    @          0x1571c39  (unknown)
    @          0x155d9cf  (unknown)
    @          0x155f914  (unknown)
    @           0x92d363  (unknown)
    @           0x92daca  (unknown)
    @           0xaa4faa  (unknown)
    @           0xaa7130  (unknown)
    @           0xca79b3  (unknown)
    @       0x386be079d1  (unknown)
    @       0x386bae8b6d  (unknown)
11:13:58.940 AM INFO    impala-server.cc:824    
UnregisterQuery(): query_id=d4269ff898eb4e7:1866144af0d14a7
11:13:58.940 AM INFO    impala-server.cc:893    
Cancel(): query_id=d4269ff898eb4e7:1866144af0d14a7
11:13:59.935 AM INFO    ClientCnxn.java:975 
Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error)
11:13:59.935 AM WARN    ClientCnxn.java:1102    
Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
Java exception follows:
java.net.ConnectException: Connection refused
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
11:14:01.036 AM INFO    ClientCnxn.java:975 
Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error)
11:14:01.037 AM WARN    ClientCnxn.java:1102    
Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
Java exception follows:
java.net.ConnectException: Connection refused
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
11:14:02.138 AM INFO    ClientCnxn.java:975 
Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error)
11:14:02.138 AM WARN    ClientCnxn.java:1102    
Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
Java exception follows:
java.net.ConnectException: Connection refused
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:739)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
11:14:02.199 AM INFO    impala-hs2-server.cc:795    
GetSchemas(): request=TGetSchemasReq 
  01: sessionHandle (struct) = TSessionHandle 
    01: sessionId (struct) = THandleIdentifier 
      01: guid (string) = "\xf8\xb9n\xe4\xb4\xf6N\xef\xad)9W.\x92#Y",
      02: secret (string) = "\xc0?\xc7\xd9\x930C\x9b\xb5\xf6K\x8em\xcb\xf8\xe4",
    ,
  ,

11:14:02.203 AM INFO    MetadataOp.java:414 
Returning 19 schemas

好像hbase表B不是启用也不是禁用,很奇怪。我google了一下,是hbase安全问题还是impala版本问题?

有人遇到过同样的问题吗?如何解决?提前谢谢。

【问题讨论】:

【参考方案1】:

从 Impala 配置启用 HBase 服务。

您可以从 Cloudera 管理器 Imapala->配置中执行此操作 从“Hbase”搜索并启用该服务。 粉煤灰。

【讨论】:

以上是关于为啥 Impala 不能在 hbase 表上工作?的主要内容,如果未能解决你的问题,请参考以下文章

使用 Impala 访问 Hbase 表时所有 SQL 操作都可以工作吗?

Impala 2.2 avro select * 查询不工作

通过 Impala 在 HBase 上创建表

怎么理解impala(impala工作原理是什么)

为啥 Impala 表定义不复制?

为啥列表的第一项显示在打开的工作表上