我正在努力将我的功能性 hadoop 安装与 python 连接的第一步。这是我的主节点(本地网络)。
这是我尝试到达主节点时发生的情况:
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'
我不确定我做错了什么,我在很多不同的报告中发现了这个问题。我根据文档设置了我的环境变量。这是我的 .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'
直接从我的主节点运行此脚本时,我似乎遇到了不同的错误。这是否意味着我不能将此脚本用作客户端脚本?我错过了一步吗?
谢谢。