TSocket读取0个字节-happybase版本0.8

时间:2018-11-20 16:15:45

标签: python hbase thrift happybase

我正在尝试通过happybase框架版本0.8连接hbase。

我已经开始守护进程- /usr/hdp/current/hbase-master/bin/hbase-daemon.sh start thrift -p 9090

 from happybase.connection import Connection
 DEFAULT_HOST = '10.128.121.13'
 DEFAULT_PORT = 9090
 DEFAULT_TRANSPORT = 'framed'
 DEFAULT_COMPAT = '0.96'`

 cc = Connection(DEFAULT_HOST,DEFAULT_PORT,None,True,None,'_',DEFAULT_COMPAT,DEFAULT_TRANSPORT) print(cc.tables())`

我是否需要在所有节点(Hbase主服务器和RegionServers)中启动Thrift服务?

我收到此错误:

  

TSocket读取0字节

1 个答案:

答案 0 :(得分:0)

如果它是分布式集群,则不必分别运行每个节点的Thrift服务器。

似乎与Connection的实例化有关。尝试以下操作:

conn = happybase.Connection( host='DEFAULT_HOST', port='DEFAULT_PORT', protocol='compact' )

您也可以查看此问题:https://github.com/wbolster/happybase/issues/193