thrift.transport.tttransport.tttransportexception:无法启动sasl:b'sasl\u client\u start(-12)中出错sasl库未初始化'

nwlls2ji  于 2021-06-26  发布在  Hive
关注(0)|答案(0)|浏览(330)

我有windows server 2008 r2和python操作系统

C:\Windows\system32>C:\Software\Python36\python --version
Python 3.6.4

已安装的库

future (0.16.0)
pip (9.0.1)
pure-sasl (0.4.0)
PyHive (0.5.0)
sasl (0.2.1)
setuptools (28.8.0)
six (1.11.0)
thrift (0.11.0)
thrift-sasl (0.3.0)

尝试将客户端写入配置单元数据库

import pyhs2 as hive
import getpass
DEFAULT_DB = 'default'
DEFAULT_SERVER = 'hive_server'
DEFAULT_PORT = 10010
DEFAULT_DOMAIN = 'mydomain'

# u = raw_input('Enter PAM username: ')

# s = getpass.getpass()

u="tech_user"
s="tech_passwd"
connection = hive.connect(host=DEFAULT_SERVER, port= DEFAULT_PORT, authMechanism='LDAP', user=u + '@' + DEFAULT_DOMAIN, password=s)

执行后返回错误

File "C:\Software\Python36\lib\site-packages\pyhive\hive.py", line 159, in __init__
    self._transport.open()
  File "C:\Software\Python36\lib\site-packages\thrift_sasl\__init__.py", line 79, in open
    message=("Could not start SASL: %s" % self.sasl.getError()))
thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error in sasl_client_start (-12) SASL library is not initialized'

如何解决这个问题?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题