1

我是 hbase 新手,想按照这里的教程使用 happybase:https ://happybase.readthedocs.org/en/latest/user.html#establishing-a-connection 代码如下:

connection = happybase.Connection(host='10.0.0.11', port=16000);
connection.open()
table = connection.table('users')
list(table.scan())

但我总是遇到节俭问题:

thrift.transport.TTransport.TTransportException: TSocket read 0 bytes

任何人都知道如何解决这个问题?我在linux上。谢谢

4

2 回答 2

1

启动节俭守护进程

sudo /usr/lib/hbase/hbase-1.1.3/bin/hbase-daemon.sh start thrift

根据您的机器更改 hbase-daemon.sh2 路径

默认情况下,thrift 监听 9090 端口

连接到 hbase

connection = happybase.Connection()
于 2016-03-29T07:07:01.150 回答
0

确保您连接到 Thrift 守护程序(您必须从 HBase 本身单独启动它)。还要确保 Thrift 传输(transport=...Happybase 中的参数)与服务器使用的传输相匹配。

于 2015-09-22T11:48:39.693 回答