我正在尝试从python代码连接到hbase-1.2.6,如下:
import happybase
connection = happybase.Connection(host='localhost',port=16010)
table = connection.table('blogpost')
table.put('1', {'post:title': 'hello world1'})
我手动在hbase中创建了表 - “blogpost”。我使用的是python-2.7和happybase-1.1.0。
错误日志如下:
/usr/bin/python2.7 /home/spark/PycharmProjects/PySpark/hbase.py 回溯(最近一次调用最后一次):
File "/home/spark/PycharmProjects/PySpark/hbase.py", line 5, in <module>
table.put('1', {'post:title': 'hello world1'})
File "/usr/local/lib/python2.7/dist-packages/happybase/table.py", line 464, in put
batch.put(row, data)
File "/usr/local/lib/python2.7/dist-packages/happybase/batch.py", line 137, in __exit__
self.send()
File "/usr/local/lib/python2.7/dist-packages/happybase/batch.py", line 60, in send
self._table.connection.client.mutateRows(self._table.name, bms, {})
File "/usr/local/lib/python2.7/dist-packages/thriftpy/thrift.py", line 198, in _req
return self._recv(_api)
File "/usr/local/lib/python2.7/dist-packages/thriftpy/thrift.py", line 210, in _recv
fname, mtype, rseqid = self._iprot.read_message_begin()
文件“thriftpy / protocol / cybin / cybin.pyx”,第439行,在cybin.TCyBinaryProtocol.read_message_begin(thriftpy / protocol / cybin / cybin.c:6470) cybin.ProtocolError:没有协议版本标题
感谢。 处理以退出代码1完成