thrift.transport.TTransport.TTransportException: Could not start SASL: b'Error in sasl_client_start (-12) SASL library is not initialized'

时间:2018-02-01 18:11:41

标签: python hive sasl

I have OS windows Server 2008 R2 and python

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

installed libs

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)

Tried write client to Hive DB

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)

After executed return error

  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' 

How solve this problem?

0 个答案:

没有答案