仅在给出hbase.zookeeper.quorum时连接到HBase

时间:2014-10-16 08:57:12

标签: python hbase apache-zookeeper happybase

给出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 :(得分:0)

我遇到了同样的错误,因为没有运行thrift的服务器。修正了:

hbase thrift start -threadpool