【发布时间】:2018-10-22 21:36:49
【问题描述】:
我花了很多时间尝试通过 python 与 kereberized impala 服务器建立连接。使用 java jdbc 是可能的。我认为这不是 kereberos 票证问题。如果我运行 klist,我可以毫无问题地看到我的票。
Ticket cache: FILE:/tmp/krb5cc_4356
Default principal: xx@xx.xx.xx
Valid starting Expires Service principal
05/12/18 20:17:22 05/13/18 06:17:22 krbtgt/xx.xx.xx@xx.xx.xx
renew until 05/19/18 20:17:22
我使用自己的 krb5.config 文件,就像我之前所说的,我可以将它与 java 一起使用,所以我看不出问题出在哪里。 我的字符串连接:
conn = connect(host='impala/_HOST@xx.xx.xx, port=21050, auth_mechanism='GSSAPI', user='xx', password='xx', database = 'xx', kerberos_service_name='impala')
我总是遇到同样的问题:
File conexionsimple.py", line 18, in <module> protocol=None)
File dbapi.py", line 147, in connect auth_mechanism=auth_mechanism)
File hiveserver2.py", line 758, in connect transport.open()
File python2.7/site-packages/thrift_sasl/__init__.py", line 68, in open self._trans.open()
File /thrift/transport/TSocket.py", line 101, in open message=message)
thrift.transport.TTransport.TTransportException: Could not connect to impala/_HOST@xx.xx.xx:21050
版本:
python 2.7.14
thrift 0.9.3
thrift-sasl 0.3
sasl 0.2
impyla 0.14
我尝试使用其他节俭版本(0.2.1),但我遇到了同样的错误。 有什么建议吗?
【问题讨论】:
标签: python-2.7 kerberos impala thrift-protocol