【发布时间】:2013-04-04 10:32:33
【问题描述】:
我正在开发一个以 hbase 作为后端的 python 应用程序。我已经安装了 hbase,它的 shell 运行良好。请注意,我还没有安装 hadoop,因为我没有节点。但是因为令人印象深刻的架构,我决定使用 hbase。
现在的问题是,我无法从 python 连接到 hbase,无论是从像 happybase 这样的库还是直接使用 thrift。我也试过这个——http://binesh.in/hbase/connecting-to-a-remote-standalone-hbase/,但没用。请帮我解决这个问题。
更新 -
> >>> import happybase
> >>> con =happybase.Connection('localhost') Traceback (most recent call last): File "<stdin>", line 1, in <module> File
> "/usr/local/lib/python2.7/dist-packages/happybase/api.py", line 121,
> in __init__
> self.open() File "/usr/local/lib/python2.7/dist-packages/happybase/api.py", line 138,
> in open
> self.transport.open() File "build/bdist.linux-i686/egg/thrift/transport/TTransport.py", line 149,
> in open File
> "build/bdist.linux-i686/egg/thrift/transport/TSocket.py", line 99, in
> open thrift.transport.TTransport.TTransportException: Could not
> connect to localhost:9090
> >>>
与直接调用几乎相同的prbm。总之,我只想在我的 python 应用程序中使用 hbase 数据库而不是 mongodb。没有 hadoop,没有 hdfs 等。这是可行的还是我正在尝试实现一些不可能的事情?
【问题讨论】:
-
您面临的确切错误是什么?请提供您拥有的 Python 代码,或者您尝试过的具体代码
-
jython 可能是一种选择,但听说它会影响性能。
-
尝试用你的IP替换
localhost -
感谢您的回复。做了,但同样的错误。也试过 127.0.0.1
-
你看过这个steps
标签: python hadoop hbase thrift