Hortonworks:无法从Python查询HBase二手服务器(Happybase)

时间:2019-05-27 07:18:39

标签: python hbase thrift happybase

我正在尝试与hortonworks DP中的HBase节俭服务器连接。

我正在将HDP 3.0与Apache HBase 2.0.0一起使用

我使用Kerberos安全性启动了HBase thrift服务器

kinit -kt /etc/security/keytabs/hbase.service.keytab hbase/node1.domain.com@domain.com && /usr/hdp/current/hbase-master/bin/hbase-daemon.sh start thrift -p 12345

起初,我在节俭时收到“ No protocol version header”错误。我想这是协议兼容性错误,所以我尝试了几件事

  • 我听说happybase不支持thirft 2,所以我对easybase进行了测试,这是happybase支持thrift2的分支。几分钟后我收到错误消息“ TSocked读取0字节”(超时?)

-然后我尝试启动服务“ thirft2”而不是“ thrift”,因为我发现它们是不同的:

kinit -kt /etc/security/keytabs/hbase.service.keytab hbase/node1.domain.com@domain.com && /usr/hdp/current/hbase-master/bin/hbase-daemon.sh start thrift2 -p 12345

但是有同样的错误。

我的代码类似于以下代码段:

import os
import easybase
os.system("kinit -kt /app/hbase.service.keytab hbase/node1.domain.com@domain.com")
connection = easybase.Connection(host="node1", port= 12345)
table = connection.table("users")
for key, data in table.scan(row_prefix="username"):
    print(key)

与happybase而不是easybase相同的错误

谢谢

0 个答案:

没有答案