使用Python模块连接到用Kerberos配置的hive数据库时,我会遇到以下错误。
kerberos_service_name should be set if and only if in KERBEROS mode
我的连接代码:
import hive from pyhive
con = hive.Connection(host="hostnamexxxxx",port=10001,
database="db_namexxxx",username="usernamexxxx",
auth="KERBEROS",
kerberos_service_name="hive")
全错误跟踪:
File "/xx/xx/site-packages/pyhive/hive.py", line 126, in __init__
raise ValueError("kerberos_service_name should be set if and only if in KERBEROS mode")
ValueError: kerberos_service_name should be set if and only if in KERBEROS mode
还尝试将kerberos_service_name更改为“attuid@ luck”,但没有成功。
你能帮帮我吗!提前感谢
发布于 2021-02-22 11:47:07
只是在故障排除的进一步,错误被提出了在线。
if (kerberos_service_name is not None) != (auth == 'KERBEROS'): raise ValueError("kerberos_service_name should be set if and only if in KERBEROS mode")
。
因此,请检查auth输出,当我从配置解析器获得身份验证值时,它包含了word 'KERBEROS‘中的引号,因此与字符串'KERBEROS’相比返回false。
即‘KERBOROS’==‘KERBOROS’‘
https://stackoverflow.com/questions/66312990
复制相似问题