快乐的基础集成不能与hbase一起使用

时间:2016-05-26 13:38:15

标签: python-2.7 hbase data-science happybase

我能够连接我的hbase

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

这两个命令没有任何错误。但是当我运行下面的cammand时,我得到了以下错误

    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

我正在使用Hbase version:1.1.2.2.3.4.0-3485

如果您可以建议任何可用于使用python

编码hbase的软件包,请提供帮助

1 个答案:

答案 0 :(得分:1)

happybase要求您连接到您需要在hbase群集上启动的thrift守护程序。 happybase不直接连接到hbase节点。

从端口号判断,您没有连接到thrift(默认使用端口9090),而是连接到hbase主服务器。这不是happybase的工作方式。