简体   繁体   English

Python 2.6.6和蜂巢连接问题?

[英]Python 2.6.6 and hive connectivity issue?

I have a VM with default Python version 2.6.6 and hive 1.2. 我有一个默认Python版本2.6.6和hive 1.2的VM。 I have installed pyhs2 successfully. 我已经成功安装了pyhs2。 But when I run the python script I get the error below. 但是,当我运行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

In my hive-site.xml I have the below configuration. 在我的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>

When I use the below script: 当我使用以下脚本时:

with pyhs2.connect(host='localhost', port=10000, authMechanism="NONE", user='hive', password='hive', database='xxxx') as conn:

I get the error below: 我收到以下错误:

NotImplementedError: authMechanism is either not supported or not implemented.

Please help! 请帮忙!

Please note that client will not allow me to upgrade the python version or to change the authentication mechanism in Hive. 请注意,客户端不允许我升级python版本或更改Hive中的身份验证机制。

Thanks in advance. 提前致谢。

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

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

authMechanisms should be one of these authMechanisms应该是其中之一

2) Error on thrift.transport.TTransport.TTransportException: Could not connect to localhost:10000 Type netstat -a -n | grep 10000 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 and check service is listening on port 10000 netstat -a -n | grep 10000并检查服务正在侦听端口10000

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

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