仅提供hbase.zookeeper.quorum时如何连接HBase

2 投票
1 回答
1822 浏览
提问于 2025-04-27 21:51

hbase-site.xml 文件内容是这样的:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <property>
        <name>hbase.zookeeper.quorum</name>
        <value>a.example.com,b.example.com,c.example.com</value>
    </property>
    <property>
        <name>hbase.zookeeper.property.clientPort</name>
        <value>2181</value>
    </property>
</configuration>

我该如何用 happybase 连接到 HBase 呢?

我尝试用下面的方式连接其中一个:

import happybase
conn = happybase.Connection('a.example.com', port=2181)
conn.open()
conn.close()

结果出现了以下错误:

...
thrift.transport.TTransport.TTransportException: Could not connect to a.example.com:2181
暂无标签

1 个回答

0

我也遇到了同样的错误,因为没有运行thrift服务器。通过以下方法解决了这个问题:

hbase thrift start -threadpool

撰写回答