Transport exception

不羁岁月 提交于 2019-12-23 18:54:41

问题


I'm trying to import happybase but gets the following error message while connecting. I have Hadoop pseudonode cluster and Hbase already running. Version of the components installed are as follows, Hadoop version - 1.0.4 Hbase version - 0.94.4 happybase -0.4

Can someone have a look into the exceptions below and let me know, if any thrift specific settings or any guidance in getting this fixed.

Thank you.

Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49) 
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import happybase

connection = happybase.Connection('localhost')

Traceback (most recent call last):

 File "<stdin>", line 1, in <module>
    File "/Library/Python/2.6/site-packages/happybase/api.py", line 121, in __init__
    self.open()

    File "/Library/Python/2.6/site-packages/happybase/api.py", line 138, in open
    self.transport.open()

    File "/Library/Python/2.6/site-packages/thrift/transport/TTransport.py", line 149, in open
    return self.__trans.open()

    File "/Library/Python/2.6/site-packages/thrift/transport/TSocket.py", line 99, in open
    message=message)

    thrift.transport.TTransport.TTransportException: Could not connect to localhost:9090

回答1:


make sure you have thrift server started before you try to connect.

hbase thrift start -threadpool



回答2:


connection = happybase.Connection('localhost','2181')



回答3:


The trift server hast to be up and running. Your connection has to be opened as well:

nohup hbase thrift start &

Open connection in python before use:

connection.open()

Example:

#!/usr/bin/python
import happybase
connection = happybase.Connection('localhost', autoconnect=False)
connection.open()



回答4:


this worked for me:

sudo server hbase-thrift restart 


来源:https://stackoverflow.com/questions/14701608/transport-exception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!