首页 \ 问答 \ Hbase超时错误不断发生(Hbase timeout errors keep occuring)

Hbase超时错误不断发生(Hbase timeout errors keep occuring)

我正在使用带有python的happybase访问Hbase。

我有一个非常简单的功能:

def connect():

    connection = happybase.Connection('myhost',myport)
    table = connection.table('MY-TABLE')
    try:
        return str(table.row('my-row'))
    except Exception as ioe:
        return str(ioe)
    finally:
        connection.close()

当我运行这个功能它工作正常几分钟,然后我开始得到超时错误。

修复是进入Hbase控制台并打开一个新的thrift端口,并指向它。

这再次工作几分钟,然后我再次得到超时错误。

不是一个好的解决方案,任何想法为什么会发生这种情况?

编辑

这是错误:

`Traceback (most recent call last):
  File "appi.py", line 38, in <module>
    print connectx()
  File "appi.py", line 26, in connectx
    print str(table.row('1464242429566-2531079631688429'))
  File "C:\Users\me\Downloads\happybase-master\happybase-master\happybase\table.py", line 116, in row
    self.name, row, columns, {})
  File "C:\Python27\lib\site-packages\thriftpy-0.3.8-py2.7.egg\thriftpy\thrift.py", line 160, in _req
    return self._recv(_api)
  File "C:\Python27\lib\site-packages\thriftpy-0.3.8-py2.7.egg\thriftpy\thrift.py", line 172, in _recv
    fname, mtype, rseqid = self._iprot.read_message_begin()
  File "C:\Python27\lib\site-packages\thriftpy-0.3.8-py2.7.egg\thriftpy\protocol\binary.py", line 372, in read_message_begin
    self.trans, strict=self.strict_read)
  File "C:\Python27\lib\site-packages\thriftpy-0.3.8-py2.7.egg\thriftpy\protocol\binary.py", line 164, in read_message_begin
    sz = unpack_i32(inbuf.read(4))
  File "C:\Python27\lib\site-packages\thriftpy-0.3.8-py2.7.egg\thriftpy\transport\__init__.py", line 32, in read
    return readall(self._read, sz)
  File "C:\Python27\lib\site-packages\thriftpy-0.3.8-py2.7.egg\thriftpy\transport\__init__.py", line 14, in readall
    chunk = read_fn(sz - have)
  File "C:\Python27\lib\site-packages\thriftpy-0.3.8-py2.7.egg\thriftpy\transport\buffered\__init__.py", line 39, in _read
    self._rbuf = BytesIO(self._trans.read(max(sz, self._buf_size)))
  File "C:\Python27\lib\site-packages\thriftpy-0.3.8-py2.7.egg\thriftpy\transport\socket.py", line 108, in read
    buff = self.sock.recv(sz)
socket.timeout: timed out`

I'm accessing Hbase using happybase with python.

I've a very simple function:

def connect():

    connection = happybase.Connection('myhost',myport)
    table = connection.table('MY-TABLE')
    try:
        return str(table.row('my-row'))
    except Exception as ioe:
        return str(ioe)
    finally:
        connection.close()

When I run this function it works fine for a few minutes, then I start getting timeout errors.

The fix is to go into Hbase console and open a new thrift port, and point to that.

This works again for a few minutes and then I get the timeout errors again.

Not a good fix, any idea why this might be happening?

EDIT

Here is error:

`Traceback (most recent call last):
  File "appi.py", line 38, in <module>
    print connectx()
  File "appi.py", line 26, in connectx
    print str(table.row('1464242429566-2531079631688429'))
  File "C:\Users\me\Downloads\happybase-master\happybase-master\happybase\table.py", line 116, in row
    self.name, row, columns, {})
  File "C:\Python27\lib\site-packages\thriftpy-0.3.8-py2.7.egg\thriftpy\thrift.py", line 160, in _req
    return self._recv(_api)
  File "C:\Python27\lib\site-packages\thriftpy-0.3.8-py2.7.egg\thriftpy\thrift.py", line 172, in _recv
    fname, mtype, rseqid = self._iprot.read_message_begin()
  File "C:\Python27\lib\site-packages\thriftpy-0.3.8-py2.7.egg\thriftpy\protocol\binary.py", line 372, in read_message_begin
    self.trans, strict=self.strict_read)
  File "C:\Python27\lib\site-packages\thriftpy-0.3.8-py2.7.egg\thriftpy\protocol\binary.py", line 164, in read_message_begin
    sz = unpack_i32(inbuf.read(4))
  File "C:\Python27\lib\site-packages\thriftpy-0.3.8-py2.7.egg\thriftpy\transport\__init__.py", line 32, in read
    return readall(self._read, sz)
  File "C:\Python27\lib\site-packages\thriftpy-0.3.8-py2.7.egg\thriftpy\transport\__init__.py", line 14, in readall
    chunk = read_fn(sz - have)
  File "C:\Python27\lib\site-packages\thriftpy-0.3.8-py2.7.egg\thriftpy\transport\buffered\__init__.py", line 39, in _read
    self._rbuf = BytesIO(self._trans.read(max(sz, self._buf_size)))
  File "C:\Python27\lib\site-packages\thriftpy-0.3.8-py2.7.egg\thriftpy\transport\socket.py", line 108, in read
    buff = self.sock.recv(sz)
socket.timeout: timed out`

原文:https://stackoverflow.com/questions/37570762
更新时间:2019-12-13 07:37

最满意答案

通过设置hbase-site.xml的属性来增加超时,该属性将在hbase/conf

<property>
    <name>hbase.regionserver.lease.period</name>
    <value>900000</value> <!-- 900 000, 15 minutes -->
  </property>
  <property>
    <name>hbase.rpc.timeout</name>
    <value>900000</value> <!-- 15 minutes -->
  </property>
<property>
    <name>zookeeper.session.timeout</name>
    <value>20000</value>
</property>

Increase the time-out by setting the property in hbase-site.xml which will be available in hbase/conf

<property>
    <name>hbase.regionserver.lease.period</name>
    <value>900000</value> <!-- 900 000, 15 minutes -->
  </property>
  <property>
    <name>hbase.rpc.timeout</name>
    <value>900000</value> <!-- 15 minutes -->
  </property>
<property>
    <name>zookeeper.session.timeout</name>
    <value>20000</value>
</property>
2016-06-01

相关问答

更多

使用Scala Guice将特征绑定到对象(Binding a trait to an object with Scala Guice)

所以问题是guice不会搜索你的程序并找到你在任何地方加载的所有@Inject点。 相反,需要给它一些路径来找到你希望它注入的对象。 一般来说,这是由你使用Guice的方式来处理的,因为标准模式是: val injector = Guice.createInjector(/* stuff */) val main = injector.getInstance(classOf[Main]) main.mainMethod() Guice在你要求它生成/获取的Main实例上执行注入,并递归地对@I

Asp.Net html.renderaction在本地工作,但在服务器上没有错误(Asp.Net html.renderaction works locally but not on server no error)

最后我解决了这个问题。 问题不在于角色授权。 实际上,我的WCF向我返回了大量数据,因此触发了maxBufferedSizeOverflow。 事实上,我的本地服务器上的数据少于远程服务器上的数据。 所以我通过建立分页来实现一种方法来返回更少的数据。 问题解决了 ! Finally I've solved the problem. The problem wasn't the Role Authorization. Actually, my WCF returned me to much dat

Dropwizard - 我的YML文件在哪里?(Dropwizard - Where is my YML file?)

是的,我不认为YAML文件是由它自己生成的,因为Dropwizard可以在没有它的情况下运行。 只有在调整内置配置或添加自己的 配置时 ,才需要指定AppConfiguration类并在configuration.yaml文件中提供相应的值。 PS :还有其他提供配置的方法,比如将其作为JVM args传递,如我所述,但我不建议使用它们。 Yes, I don't think a YAML file is generated by itself since Dropwizard can func

如何在dispatch_async(dispatch_get_main_queue())运行时从类方法发送信息(How send info from class method when dispatch_async(dispatch_get_main_queue()) is runing)

有多种方法可以做到这一点。 我认为最简单的部分是在downloadJSONFromURL()添加一个closure参数。 func downloadJSONFromURL(completion:((error:NSError?)->Void)) { if let httpResponse { switch(httpResponse.statusCode) { case 200: // 2. Create JSON Object with d

检查我的提交是否在emacs / git中有'import pdb'?(check if my commit has 'import pdb' in emacs/git?)

为了完整起见,这里是如何检查索引中版本的内容,构建eugene的答案以及一些更改(未作为完整钩子测试,但应该工作): #!/bin/sh has_import=false git diff --cached --no-renames --name-status --diff-filter=AM | while read st file; do case "$file" in *.py) if git show ":$file" | gre

有没有办法在运行时停止/重新启动ejb 3.1自动定时器?(Is there a way to stop/re-start ejb 3.1 automatic timer during runtime?)

在ejb Timers中,与Start&Stop相关的更接近的想法是Create&Cancel。 发布的代码显示您正在使用Automatic Timer ,它非常容易创建,但有一个缺点:Timer仅在部署时由Container自动创建。 这为Create操作留下了一小部分余地。 但是,一旦创建,就可以取消Timer,调用Timer.cancel()方法。 例如: @Singleton @Remote public class MyTimer implements MyTimerRemote {

记录时会截断大型请求(Large requests are truncated when logging)

您的问题不是表中的数据被截断,而是SSMS限制了输出中的数据大小。 所以不要担心丢失数据。 你的代码很好。 这就是为什么没有报告错误的原因。 要检查使用代码读取数据(例如使用普通的ADO.Net),您将看到存储了所有数据。 查看一些解决方案: http : //blog.extreme-advice.com/2013/03/05/error-fix-unable-to-show-xml-the-following-error-happened-there-is-an-unclosed-文字串/

BreezeJs和Chrome 33(BreezeJs and Chrome 33)

2014年3月1日更新 好的,我们认为现在可以在Breeze v 1.4.9(或更高版本)中修复此问题。 上一篇文章 这是我们一直在跟踪的问题。 它似乎只出现在Chrome 33中的Breeze的缩小版本上。我们计划在本周晚些时候进行修复。 在此之前尝试使用未经授权的版本。 Updated 3/1/2014 Ok, we think that this is fixed in Breeze v 1.4.9 ( or later) available now. Previous post This

相关文章

更多

最新问答

更多
  • jsPlumb draggable element javascript函数(jsPlumb draggable element javascript function)
  • MVC4:ViewModel(带有radiobuttonlist)在HttpPost之后为空(MVC4: ViewModel (with radiobuttonlist) is empty after HttpPost)
  • 如何在同一帐户上设置“Dev repo”(在prod和团队之间)(How to set up a “Dev repo” (between the prod and the team) on the same account)
  • 如何在tcl中将eth0配置为发送方udp端口(how to configure eth0 as a sender udp port in tcl)
  • 在main方法中进行更改后传递给构造函数的TreeMap实例的行为是什么(What is the behavior of a TreeMap instance passed into a constructor following changes in main method)
  • 在这个的一些属性不同的颜色(Different color in some properties of this)
  • CURL没有返回任何内容(CURL Not returning anything)
  • MVC5注入依赖于城堡windsor的视图(MVC5 injecting dependency on a view with castle windsor)
  • CakePHP AJAX-Call:发生错误:未定义(CakePHP AJAX-Call: An error occured: undefined)
  • 如何用.aidl扩展名创建文件?(how to create a file with .aidl extension?)
  • 无法获得全尺寸动态WordPress灯箱图像显示(Cannot get full size dynamic WordPress lightbox image to display)
  • 使用Jsoup删除元素不起作用(Removing Element with Jsoup doesn't work)
  • 交叉编译ARM的MongoDB C ++驱动程序。(Cross compiling MongoDB C++ driver for ARM. Cannot find Boost Libraries)
  • ProgressDialog没有关闭(ProgressDialog not closing)
  • 单元测试DB中的JPA插入(Unit testing JPA insertion in the DB)
  • 点击谷歌服务对话框中的更新按钮(Click on update button in check google service dialog)
  • 适用于PhoneGap Build的iOS“缺少必需的57x57图标”(“Missing required 57x57 icon” for iOS on PhoneGap Build)
  • MVC ckeditor post编辑器值内联(MVC ckeditor post editor value inline)
  • Angular 2 Pipe - 无法读取未定义的属性'toString'(Angular 2 Pipe - Cannot read property 'toString' of undefined)
  • 安装引导加载程序(Installing bootloaders)
  • 用于确定最终如何包含头文件的工具(Tool to figure out how a header file is eventually being included)
  • 在将字符串转换为int [duplicate]之前检查字符串是否不是数字(Check if string is not a number before converting it to a int [duplicate])
  • 从脚本构建db2数据库以进行构建验证的工具?(Tools to build db2 database from scripts for build verification?)
  • 在偏移之后向FileOutputStream写一个数字(Write a number to FileOutputStream after an offset)
  • Javascript RegEx仅限数字(无特殊字符)(Javascript RegEx for Numbers Only (no special characters))
  • 我可以在PHP的Linux服务器上运行新的COM(“WScript.Shell”)(Can I run new COM(“WScript.Shell”) on linux servers in PHP)
  • 在Backbone.js中放置与视图不直接相关的代码(例如广告,分析等)的位置?(Where to place code not directly related to a view (such as ads, analytics etc) in Backbone.js?)
  • 适用于Mac和PC的一般开发人员必备软件综合列表[关闭](Comprehensive List of Essential Software for General Developers on Mac and PC [closed])
  • 将语言文本转换为模型(Transformation Language Text to Model)
  • 在控制器中的两个方法之间共享变量?(Sharing variables between two methods in a controller?)