繁体   English   中英

节俭在我的HBase主人身上运行吗? 如何使用Happybase连接它?

[英]Is thrift running on my HBase master? How to connect to it with Happybase?

我在伪分布式模式下运行krejcmat/hadoop-hbase 那就是master和slave在同一台机器上的不同容器中运行。 在启动Hadoop集群和HBase之后,我在主节点上启动thrift服务器:

hbase thrift start -threadpool 

我还暴露了节点9090 (开头的默认Thrift端口--expose=9090 )。 我想使用Happybase库通过Thrift API从我的主机连接到在Hadoop集群中运行的Hbase。 这是我使用的命令:

connection = happybase.Connection('hadoop-hbase-master', 9090)

但我收到错误:

TTransportException(message="Could not connect to ('hadoop-hbase-master', 9090)", type=1)

这意味着无法访问Thrift API。 是因为Thrift服务器没有运行吗? 或者我应该在我的主机上使用某种Thrift客户端? 或者我应该在其中一个奴隶而不是主人身上运行节俭服务器?

谢谢,Sepideh

我开始节俭了

hbase节俭开始

然后以下代码就可以了。

import happybase
connection = happybase.Connection('localhost')

你可以试试。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM