0
我有一个默认的Python版本2.6.6和配置单元1.2的虚拟机。我已经成功安装了pyhs2。但是当我运行python脚本时,我得到下面的错误。Python 2.6.6和配置单元连接问题?
File "test.py", line 7, in <module>
with pyhs2.connect(host='localhost', port=10000, authMechanism="PLAIN", user='hive', password='hive', database='xxxx') as conn:
File "/usr/lib/python2.6/site-packages/pyhs2/__init__.py", line 7, in connect
return Connection(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/pyhs2/connections.py", line 46, in __init__
transport.open()
File "/usr/lib/python2.6/site-packages/pyhs2/cloudera/thrift_sasl.py", line 55, in open
self._trans.open()
File "/usr/lib64/python2.6/site-packages/thrift/transport/TSocket.py", line 101, in open
message=message)
thrift.transport.TTransport.TTransportException: Could not connect to localhost:10000
在我的hive-site.xml中我有下面的配置。
<property>
<name>hive.server2.authentication</name>
<value>NONE</value>
</property>
<property>
<name>javax.jdo.option.ConnectionUserName</name>
<value>hive</value>
</property>
<property>
<name>javax.jdo.option.ConnectionPassword</name>
<value>hive</value>
</property>
当我使用下面的脚本:
with pyhs2.connect(host='localhost', port=10000, authMechanism="NONE", user='hive', password='hive', database='xxxx') as conn:
我得到的错误如下:
NotImplementedError: authMechanism is either not supported or not implemented.
请帮帮忙!
请注意,客户端不会允许我升级python版本或更改Hive中的身份验证机制。
在此先感谢。