我正在尝试使用pyhs2访问配置单元。我尝试了以下代码:
示例.pyimport pyhs2
conn = pyhs2.connect(host='localhost', port=10000,authMechanism=None, user=None, password=None,database='default')
with conn.cursor() as cur:
cur.execute("select * from table")
for i in cur.fetch():
print i
我得到以下错误:Traceback (most recent call last):
File "example.py", line 2, in conn = pyhs2.connect(host='localhost', port=10000,authMechanism=None, user=None, password=None,database='default')
File "build/bdist.linux-x86_64/egg/pyhs2/__init__.py", line 7, in connect
File "build/bdist.linux-x86_64/egg/pyhs2/connections.py", line 46, in __init__
File "build/bdist.linux-x86_64/egg/pyhs2/cloudera/thrift_sasl.py", line 55, in open
File "build/bdist.linux-x86_64/egg/thrift/transport/TSocket.py", line 101, in open
thrift.transport.TTransport.TTransportException: Could not connect to localhost:10000
当我尝试使用hive-utils时,我得到了准确的错误。我已经检查过sasl的安装。我需要更改配置单元中的hive-site.xml吗?如果是,我需要在哪里创建它?我错过了什么吗?