happy base集成不能与hbase一起使用

ccgok5k5  于 2021-06-09  发布在  Hbase
关注(0)|答案(1)|浏览(454)

我可以连接我的hbase

connection = happybase.Connection(host='node-04',port=16000)
    table = connection.table('test')

这两个命令工作正常。但是当我运行下面的摄像头时,我得到了以下错误

print connection.tables()
    error                                     
    Traceback (most recent call last)
    <ipython-input-49-de0848d7286f> in <module>()
    ----> 1 print connection.tables()

    /root/anaconda2/lib/python2.7/site-packages/happybase/connection.pyc in                 tables(self)
    236         :rtype: List of strings
237         """
    --> 238         names = self.client.getTableNames()
239 
240         # Filter using prefix, and strip prefix from names

    /root/anaconda2/lib/python2.7/site-packages/happybase/hbase/Hbase.pyc in getTableNames(self)
815     @return returns a list of names
816     """
    --> 817     self.send_getTableNames()
818     return self.recv_getTableNames()
819 

    /root/anaconda2/lib/python2.7/site-packages/happybase/hbase/Hbase.pyc in send_getTableNames(self)
823     args.write(self._oprot)
824     self._oprot.writeMessageEnd()
    --> 825     self._oprot.trans.flush()
826 
827   def recv_getTableNames(self, ):

    /root/anaconda2/lib/python2.7/site-packages/thrift/transport/TTransport.pyc in flush(self)
172     # reset wbuf before write/flush to preserve state on underlying failure
173     self.__wbuf = StringIO()
    --> 174     self.__trans.write(out)
175     self.__trans.flush()
176 

    /root/anaconda2/lib/python2.7/site-packages/thrift/transport/TSocket.pyc in write(self, buff)
128     have = len(buff)
129     while sent < have:
    --> 130       plus = self.handle.send(buff)
131       if plus == 0:
132         raise TTransportException(type=TTransportException.END_OF_FILE,

    error: [Errno 32] Broken pipe

我在用HBaseversion:1.1.2.2.3.4.0-3485
请帮助,如果你能建议任何包,我可以用来代码的hbase使用python

k5hmc34c

k5hmc34c1#

happybase要求您连接到thrift守护程序,您需要在hbase集群上启动该守护程序。happybase不直接连接到hbase节点。
从端口号判断,您不是连接到thrift(默认情况下使用端口9090),而是连接到hbase主机。happybase不是这样工作的。

相关问题