thrift hbase python->thrift.transport.tttransport.tttransportexception:tsocket read 0 bytes

gr8qqesn  于 2021-05-27  发布在  Hadoop
关注(0)|答案(0)|浏览(580)

为什么联系没有建立起来,导致 thrift.transport.TTransport.TTransportException: TSocket read 0 bytes 我正在尝试使用thrift从python连接到hbase。我正在一个cloudera cdh5.14集群上工作,而且这个集群上正在运行thrift服务器。hbase版本1.2.0
已经三个星期了,我已经尝试了以下几点:通过搜索,我知道这与节俭有关,而不管python、happybase还是hbase。它是一个kerberized集群,在协议和传输模式上做了更改,如第一个链接中所述:如果使用happybase,我想这个解决方案应该也能工作。1) cloudera/cdh v6.1.x+python happybase v1.1.0:tttransportexception(type=4,message='tsocket read 0 bytes')
2) tsocket read 0 bytes-happybase版本0.8
3) 长时间运行调用的thrift超时:thrift.transport.ttTransport.ttTransportException:tsocket read 0 bytes
4) tsocket读取0字节使用python访问配置单元
5) ttTransportException:tsocket在通过python访问配置单元时读取0字节
6) python thrift错误``tsocket读取0字节```
7) 未捕获的异常“ttTransportException”,消息“tsocket read 0 bytes”
8) tsocket读取0字节apache thrift mongodb

from thrift.transport import TSocket
from thrift.protocol import TCompactProtocol
from thrift.transport.TTransport import TFramedTransport
from hbase import Hbase

(host, port) = ("cluster.hostname", 9090)
transport = TFramedTransport(TSocket.TSocket(host, port))
protocol = TCompactProtocol.TCompactProtocol(transport)
client = Hbase.Client(protocol)

transport.open()
print(client.getTableNames())

错误片段与上面链接中的大多数类似

Traceback (most recent call last):
  File "testing.py", line 14, in <module>
    print(client.getTableNames())
  File "/home/caston/final_attempt/gen-py/hbase/Hbase.py", line 786, in getTableNames
    return self.recv_getTableNames()
  File "/home/caston/final_attempt/gen-py/hbase/Hbase.py", line 796, in recv_getTableNames
    (fname, mtype, rseqid) = self._iprot.readMessageBegin()
  File "/usr/lib64/python2.7/site-packages/thrift/protocol/TCompactProtocol.py", line 310, in readMessageBegin
    proto_id = self.__readUByte()
  File "/usr/lib64/python2.7/site-packages/thrift/protocol/TCompactProtocol.py", line 289, in __readUByte
    result, = unpack('!B', self.trans.readAll(1))
  File "/usr/lib64/python2.7/site-packages/thrift/transport/TTransport.py", line 58, in readAll
    chunk = self.read(sz - have)
  File "/usr/lib64/python2.7/site-packages/thrift/transport/TTransport.py", line 276, in read
    self.readFrame()
  File "/usr/lib64/python2.7/site-packages/thrift/transport/TTransport.py", line 280, in readFrame
    buff = self.__trans.readAll(4)
  File "/usr/lib64/python2.7/site-packages/thrift/transport/TTransport.py", line 58, in readAll
    chunk = self.read(sz - have)
  File "/usr/lib64/python2.7/site-packages/thrift/transport/TSocket.py", line 120, in read
    message='TSocket read 0 bytes')
thrift.transport.TTransport.TTransportException: TSocket read 0 bytes

任何帮助都将不胜感激!

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题