pyarrow.hdfs.connect无法访问我的hadoop集群

时间:2018-05-24 13:12:22

标签: python hadoop pyarrow

我正在努力完成将功能性hadoop安装与python连接的第一步。这是我的主节点(本地网络)。

enter image description here

以下是我尝试访问主节点时发生的事情:

import pyarrow as pa 
pa.hdfs.connect("192.168.0.37",20500)

File "/usr/local/lib/python3.5/dist-packages/pyarrow/hdfs.py", line 181, in connect
kerb_ticket=kerb_ticket, driver=driver)
File "/usr/local/lib/python3.5/dist-packages/pyarrow/hdfs.py", line 35, in __init__
_maybe_set_hadoop_classpath()
File "/usr/local/lib/python3.5/dist-packages/pyarrow/hdfs.py", line 134, in _maybe_set_hadoop_classpath
classpath = subprocess.check_output([hadoop_bin, 'classpath', '--glob'])
File "/usr/lib/python3.5/subprocess.py", line 626, in check_output
**kwargs).stdout
File "/usr/lib/python3.5/subprocess.py", line 693, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'hadoop'

我不确定我做错了什么,我在很多不同的报告中发现了这个问题。我设置了我的环境变量according to the documentation。这是我的.bashrc

的结尾
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre
export HADOOP_HOME=/home/david/Apps/hadoop
export CLASSPATH='$HADOOP_HOME/bin/hdfs classpath --glob'

直接从我的主节点运行此脚本时,似乎遇到了不同的错误。这是否意味着我无法将此脚本用作客户端脚本?我错过了一步吗?

感谢。

0 个答案:

没有答案