python连接hbase出现message='No protocol version header' 报错

博客主要围绕Python连接HBase展开,指出连接时出现'message='No protocol version header''报错的原因,一是HBase的Thrift服务未启动,二是端口有误。同时介绍了Python连接HBase的步骤,包括启动Thrift服务和安装相关Python依赖库。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

目录

 

python连接hbase出现message='No protocol version header' 报错

python 连接habse所需步骤


python连接hbase出现message='No protocol version header' 报错

错误原因1: hbase的thrift服务没启动  2: 端口有误, 不是9090

启动hbase thrift服务。

[root@Machine6 hbase-1.2.0-cdh5.7.0]# bin/hbase-daemon.sh start thrift

python 连接habse所需步骤

1.启动hbase thrift服务
./hbase-daemon.sh start thrift


2.安装python 依赖库

pip install thrift
pip install hbase-thrift
pip install happybase

import happybase

if __name__ == "__main__":
    connection = happybase.Connection(host='192.168.3.173', port=9090)
    table_name_list = connection.tables()
    print(table_name_list)

结果显示:

 

 

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

千里风雪

你的鼓励是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值