【问题标题】:happybase connect to hbase get table information failedhappybase 连接 hbase 获取表信息失败
【发布时间】:2015-11-27 23:12:37
【问题描述】:

我是 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上。谢谢

【问题讨论】:

    标签: python hbase happybase


    【解决方案1】:

    启动 thrift 守护进程

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

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

    thrift 默认监听 9090 端口

    连接到 hbase

    connection = happybase.Connection()
    

    【讨论】:

      【解决方案2】:

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

      【讨论】:

        猜你喜欢
        • 2013-03-11
        • 2017-05-31
        • 2022-01-03
        • 1970-01-01
        • 2017-04-28
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-03-14
        相关资源
        最近更新 更多