【问题标题】:Python Hive-PyHive Connection reset issuePython Hive-PyHive 连接重置问题
【发布时间】:2018-08-29 15:57:22
【问题描述】:

我可以使用 PyHive 库从 Python 连接到 hive。在使用 PyHive 从 hive 获取数据时,我遇到了问题Connection reset by peer

建立连接后,我正在使用 Python 中的 PyHive 从 hive 中获取数据。连接成功,但在从 hive 获取数据时,它运行了 5 分钟以上,然后抛出 connection reset by peer

from pyhive import 
hive conn = hive.Connection(host="host1", port="",auth="", database="",kerberos_service_name="") #successfully connection established 
cur = conn.cursor() cur.execute(query1) #(sometimes it works and some times it throws "Connection reset by peer" if query runs more than 5min)

【问题讨论】:

  • 你能给我们看看relevant code好吗?
  • from pyhive import hive conn = hive.Connection(host="host1", port="",auth="", database="",kerberos_service_name="") -> 连接成功 cur = conn.cursor() cur.execute(query1) -> (如果查询运行超过 5 分钟,有时它会起作用,有时它会抛出“对等连接重置”)

标签: python hive pyhive


【解决方案1】:

无法识别来自服务器站点的连接可能会导致此错误。您可以尝试使用 pkill -9 pid 杀死您的 python 进程吗?因为如果您尝试同时使用两个 python 脚本连接到 hive,可能会导致无法识别连接。

【讨论】:

    猜你喜欢
    • 2021-05-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-11-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多