kdc-kerberos 票据缓存在默认的/tmp/krb5cc_*这个文件,会导致个严重的问题:
#!/usr/bin/env python # -*- coding:utf-8 -*- # 作者: tianjun # 时间: 2020/3/9 下午7:18 # 文件: test_deom.py # IDE: PyCharm from impala.dbapi import connect from krbcontext import krbcontext if __name__ == '__main__': hostname = '197.255.20.213' port = 21050 with krbcontext(using_keytab=True, principal='impala@YJP.COM', keytab_file='/home/keytab/impala.keytab', ccache_file='krb5cc_0'): conn = connect(host=hostname, port=port, auth_mechanism='GSSAPI', kerberos_service_name='impala') cur = conn.cursor() cur.execute("show databases") for row in cur: print(row[0]) conn2 = connect(host=hostname, port=port, auth_mechanism='GSSAPI', kerberos_service_name='impala') cur2 = conn.cursor() cur2.execute("select count(*) from yjp_trace.yjp_ods_trace") print(cur2.fetchall())
上一个:@NotNull注解失效原因之一