python - TSocket 读取 0 字节 - happybase 版本 0.8
问题描述
我正在尝试通过happybase框架版本0.8连接hbase。
我已经开始守护进程 -
/usr/hdp/current/hbase-master/bin/hbase-daemon.sh start thrift -p 9090
from happybase.connection import Connection
DEFAULT_HOST = '10.128.121.13'
DEFAULT_PORT = 9090
DEFAULT_TRANSPORT = 'framed'
DEFAULT_COMPAT = '0.96'`
cc = Connection(DEFAULT_HOST,DEFAULT_PORT,None,True,None,'_',DEFAULT_COMPAT,DEFAULT_TRANSPORT) print(cc.tables())`
我是否需要在所有节点、Hbase master 和 RegionServers 中启动 thrift 服务?
我收到了这个错误:
TSocket 读取 0 个字节
解决方案
如果是分布式集群,则不必单独运行每个节点的thrift server。
连接的实例化似乎有问题。尝试以下:
conn = happybase.Connection( host='DEFAULT_HOST', port='DEFAULT_PORT', protocol='compact' )
你也可以看看这个问题:https ://github.com/wbolster/happybase/issues/193
推荐阅读
- html - 使用 v-model
- python - 如何在海龟图形模块中找到海龟的 x 和 y 坐标?
- python - 在列表中使用字典时将字符串转换为浮点数的问题
- python - 在帝国时代 3 中模拟按键
- symfony - 如何根据 Symfony 3.4 应用程序中的应用程序环境为 nginx error_page 提供不同的模板?
- php - Laravel:无法在视图中显示数据库中的图像
- angular - 转换 api 结果以从额外的 api 请求中收集额外的数据
- javascript - 如何使用机器人框架执行 jquery?
- php - Mysqli 语句执行在 PHP 中不起作用
- jquery - Litelement querySelector 为 Null