我正在尝试在独立模式下运行hadoop。当我尝试执行
命令时bin/hadoop jar hadoop-mapred-examples-0.21.0.jar grep input output
我得到以下错误:
laxmikant@laxmikant-Inspiron-1464:~/Work/hadoop-0.21.0$ bin/hadoop jar hadoop-mapred- examples-0.21.0.jar grep input output
/home/laxmikant/Work/hadoop-0.21.0/bin/hadoop-config.sh: line 189: /home/laxmikant/java/jdk1.7.0_04/bin/java: Permission denied
bin/hadoop: line 120: /home/laxmikant/java/jdk1.7.0_04/bin/java: Permission denied
bin/hadoop: line 120: exec: /home/laxmikant/java/jdk1.7.0_04/bin/java: cannot execute: Permission denied
如何删除错误?
运行hadoop
的用户似乎没有运行java
的权限。但是通过查看java二进制文件所在的路径(/home/laxmikant/java/),它应该很容易被用户laxmikant
或root用户访问。因此,如果您试图以用户laxmikant
的身份执行它,但仍然得到错误,那么,可能没有正确安装Java。还要确保在hadoop的conf/hadoop-env.sh中正确设置JAVA_HOME
。