【问题标题】:How to deal with thrift client disconnection issue如何处理 Thrift 客户端断开连接问题
【发布时间】:2013-02-19 20:06:25
【问题描述】:

我的项目使用bottle和HBase,客户端通过python thrift客户端连接到HBase,代码简化成这样

#!/usr/bin/env python

from bottle import route, run, default_app, request

client = HBaseClient()

@route('/', method='POST')
def index():
    data = client.getdata()
    return data

现在的问题是如果客户端断开连接,我们的请求将失败。所以它需要确保客户端保持活力。

一种解决方案是使用连接池,有什么连接池可以参考吗?

此问题还有其他解决方案吗?

【问题讨论】:

    标签: python hbase connection-pooling thrift reconnect


    【解决方案1】:

    看起来happybase可以解决这个问题

    【讨论】:

      【解决方案2】:

      HappyBase 有一个连接池,在某种程度上尝试处理断开的连接:http://happybase.readthedocs.org/en/latest/user.html#using-the-connection-pool

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-03-25
        • 2012-06-18
        • 1970-01-01
        • 2016-03-10
        • 1970-01-01
        相关资源
        最近更新 更多