我試圖設置一個配置單元連接,如下所述:How to Access Hive via Python?使用配置單元。與python 3.5.2(安裝在cloudera Linux BDA上)連接,但SASL包似乎會導致問題。我在論壇上看到,SASL僅與2.7 python兼容。是對的嗎?我錯過/做錯了什麼?Pyhive,SASL和Python 3.5
from pyhive import hive
conn = hive.Connection(host="myserver", port=10000)
import pandas as pd
錯誤消息
TTransportException Traceback (most recent call last)
in()
1 from pyhive import hive
2 #conn = hive.Connection(host="myserver", port=10000)
----> 3 conn = hive.Connection(host="myserver")
4 import pandas as pd
/opt/anaconda3/lib/python3.5/site-packages/pyhive/hive.py in init(self, host, port, username, database, auth, configuration)
102
103 try:
--> 104 self._transport.open()
105 open_session_req = ttypes.TOpenSessionReq(
106 client_protocol=protocol_version,
/opt/anaconda3/lib/python3.5/site-packages/thrift_sasl/init.py in open(self)
70 if not ret:
71 raise TTransportException(type=TTransportException.NOT_OPEN,
---> **72 message=("Could not start SASL: %s" % self.sasl.getError()))**
73
74 # Send initial response
TTransportException: TTransportException(message="Could not start SASL: b'Error in sasl_client_start (-4) SASL(-4): no mechanism available: No worthy mechs found'", type=1)
我的hive.server2.authentication設置爲CUSTOM,所以我需要做什麼?如何? –
以下pyhive代碼:'raise NotImplementedError( 「Only only NONE,NOSASL,LDAP,KERBEROS」 「authentication is supported,got {}」。format(auth))'實際上我不知道。對不起,沒有幫助 –