Happybase与hbase连接时出错

时间:2013-03-21 16:17:27

标签: python hbase thrift happybase

>>>import happybase
>>>cnx=happybase.Connection('localhost')

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/seyf/envname/local/lib/python2.7/site-packages/happybase/api.py", line 121, in __init__
self.open()
File "/home/seyf/envname/local/lib/python2.7/site-packages/happybase/api.py", line 138, in open
self.transport.open()
File "/home/seyf/envname/local/lib/python2.7/site-packages/thrift/transport/TTransport.py", line 149, in open
return self.__trans.open()
File "/home/seyf/envname/local/lib/python2.7/site-packages/thrift/transport/TSocket.py", line 99, in open
message=message)
thrift.transport.TTransport.TTransportException: Could not connect to localhost:9090

2 个答案:

答案 0 :(得分:6)

首先,确保thrift服务器正在运行:

hbase thrift start

然后确保获得正确的端口号(默认为9090)\

cnx=happybase.Connection('localhost', port=xxxx)

答案 1 :(得分:0)

这看起来像网络问题。你真的启动了Thrift服务器吗? (它与HBase守护程序本身的过程不同。)