python - Python 程序以 Http 模式通过 Thrift 服务器连接到 HBase
问题描述
我正在尝试编写一个简单的程序来通过以 Http 模式启动的 thrift 连接到 HBase 服务器。(集群是 kerberized )但我总是收到“读取零字节错误消息”
我参考了下面的链接,但这些示例仅在节俭服务器以二进制模式启动时才有效(??) https://github.com/joshelser/hbase-thrift1-python-sasl/blob/master/get_row.py,
我做了 Klist 和 Kinit 一切看起来都很好,我也遵循了 HDP 文档,我的设置是正确的
当我运行以下命令时,我能够列出表格
hbase org.apache.hadoop.hbase.thrift.HttpDoAsClient 主机 9090 hbase true
非常感谢任何对通过 thrift http 模式连接到 HBase 的示例代码的参考
谢谢你
解决方案
Error "read 0 bytes" is very generic message that appear when server gets an exception. Better check thrift server logs to get exact error message stack trace. If logs are not getting generated then you need to set up minimal logging to the server side.
import logging
logging.basicConfig(level=logging.DEBUG)
You might also need to increase hbase.thrift.server.socket.read.timeout
to keep the connection open for optimal processing time.
You can find the sample python code here.
推荐阅读
- sql-server - 如何在sql server中添加具有自动增量的主键列
- javascript - 在表中单击时对 tbody 中的排序数据作出反应
- r - 卡方检验 (R) 无法解释的结果
- typescript - 遇到 = inside <> 时出现 tsconfig 错误
- java - 控制器中的异常没有在junit中执行
- spring-boot - logstash-logback-encoder 仅发送与某些包相关的日志
- android - 发布我的应用程序
- javascript - 一个可观察的多个订阅者 Rxjs/Angular 共享不起作用
- php - 如何从目录中单击一次获取多个图像
- odbc - Visual FoxPro DB - 使用 ODBC 创建/更新/删除表