未找到 Hadoop 命令

2022-09-02 02:39:16

我已经在Linux机器中安装并配置了hadoop。现在我正在尝试运行一个示例MR作业。我已经通过命令/usr/local/hadoop/bin/start-all.sh 启动了hadoop,输出是

namenode running as process 7876. Stop it first.
localhost: datanode running as process 8083. Stop it first.
localhost: secondarynamenode running as process 8304. Stop it first.
jobtracker running as process 8398. Stop it first.
localhost: tasktracker running as process 8612. Stop it first.

所以我认为我的hadoop配置成功了。但是当我尝试运行以下命令时,它给出了

jeet@jeet-Vostro-2520:~$ hadoop fs -put gettysburg.txt /user/jeet/getty/gettysburg.txt
hadoop: command not found

我是哈杜普的新手,有人请帮忙。我还发布了我正在尝试的内容的屏幕截图enter image description here


答案 1

从您的命令历史记录中可以看出,您可以将其替换为,这应该会有所帮助。hadoop/usr/local/hadoop/bin/hadoop


如果要使用命令而不指定其完整路径,则可以编辑文件并添加以下行:hadoop~/.bashrc

export PATH=$PATH:/usr/local/hadoop/bin/

然后,您需要重新打开终端。


答案 2

编辑变量,如果您希望能够在不指定完整路径的情况下调用 hadoopPATH

export PATH=$PATH:/usr/local/hadoop/bin/

如果你想要它为每个bash配置文件,然后编辑以包括这个~/.bash_profile


推荐