繁体   English   中英

Python 2.6.6和蜂巢连接问题?

[英]Python 2.6.6 and hive connectivity issue?

我有一个默认Python版本2.6.6和hive 1.2的VM。 我已经成功安装了pyhs2。 但是,当我运行python脚本时,出现以下错误。

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中的身份验证机制。

提前致谢。

1)检查此https://github.com/BradRuderman/pyhs2/blob/master/pyhs2/connections.py

authMechanisms = set(['NOSASL', 'PLAIN', 'KERBEROS', 'LDAP'])

authMechanisms应该是其中之一

2) thrift.transport.TTransport.TTransportException: Could not connect to localhost:10000错误thrift.transport.TTransport.TTransportException: Could not connect to localhost:10000类型netstat -a -n | grep 10000 netstat -a -n | grep 10000并检查服务正在侦听端口10000

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM