【发布时间】:2020-05-19 16:21:51
【问题描述】:
我的python版本是3.7,在我运行pip3 install happybase之后,我启动了hbase thrift start这个命令,并尝试写一个简短的.py文件如下:
import happybase
connection = happybase.Connection('master')
table = connection.table('jmlr') #'jmlr' is a table in hbase
for i in table.scan():
print(i)
table.put('001', {'title':'dasds'}) #error here
connection.close()
在即将运行table.put()时,报了这样一个错误:
thriftpy2.transport.base.TTransportException: TTransportException(type=4, message='TSocket read 0 bytes')
同时thrift报错:
ERROR [thrift-worker-1] thrift.TBoundedThreadPoolServer: Error occurred during processing of message. java.lang.IllegalArgumentException: Invalid famAndQf provided.
但是刚才我再次运行了这个python文件,它在thrift中给了我一个不同的错误:
thrift.TBoundedThreadPoolServer: Thrift error occurred during processing of message.
org.apache.thrift.protocol.TProtocolException: Bad version in readMessageBegin
我曾尝试添加protocol='compact', transport='framed' 之类的参数,但这不起作用,甚至table.scan() 也失败了。
hbase shell里的一切都OK了,搞不明白哪里出了问题,快崩溃了。
【问题讨论】:
-
对了,我在master主机上运行这个文件,需要设置什么吗?
标签: hadoop hbase python-3.7 happybase