【问题标题】:Error - b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: Unable to find a callback: 2'错误 - b'sasl_client_start (-4) SASL(-4) 中的错误:没有可用的机制:无法找到回调:2'
【发布时间】:2020-02-04 08:15:26
【问题描述】:

我正在尝试通过 Python(Jupyter Notebooks)连接到 HIVE。我已经安装了使用 Python 连接 HIVE 所需的所有软件包 -

sasl                      0.2.1            py37h8a4fda4_1
thrift                    0.13.0                   pypi_0    pypi
thrift-sasl               0.3.0                    pypi_0    pypi
pyhive                    0.6.1                    pypi_0    pypi

from pyhive import hive
conn = hive.Connection(host="xxxxxxx", port=xxxxx, username="xxxxxxxx")

但由于抛出错误而无法连接:TTransportException: Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: Unable to find a callback: 2'

我错过了什么吗?如何连接?

【问题讨论】:

  • +1: PS C:\tools> python .\run.py Traceback(最近一次调用最后):文件“.\run.py”,第 12 行,在 cursor = hive .connect(host=HIVE_HOST, port=HIVE_PORT, 无法启动 SASL: b'在 sasl_client_start (-4) SASL(-4) 中出错: 没有可用的机制: 无法找到回调: 2'可用的机制: 无法找到回调:2'

标签: python python-3.x hive


【解决方案1】:

在 Windows 平台上,您需要将路径添加到 win reestr 到您的 C:\PyProj\MyProj\venv\Lib\site-packages\sasl\sasl2 目录。在win命令行中: C:\Windows\system32>REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Carnegie Mellon\Project Cyrus\SASL 库" /v SearchPath /t REG_SZ /d "C:\PyProj\MyProj\venv\Lib\site-packages\sasl\sasl2 "

【讨论】:

    【解决方案2】:

    您可以尝试安装以下软件包:

    yum install cyrus-sasl-plain  cyrus-sasl-devel  cyrus-sasl-gssapi
    

    这对我有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-01-19
      • 2018-06-12
      • 2019-03-21
      • 1970-01-01
      • 2012-09-02
      • 1970-01-01
      相关资源
      最近更新 更多