在独立模式下执行hadoop示例时权限被拒绝

inb24sb2  于 2021-06-03  发布在  Hadoop
关注(0)|答案(1)|浏览(380)

我正在尝试在独立模式下运行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

如何删除错误?

c0vxltue

c0vxltue1#

似乎您运行的用户 hadoop 没有权限运行 java . 但是通过查看java二进制文件所在的路径(/home/laxmikant/java/),用户应该可以很容易地访问它 laxmikant 或根用户。因此,如果您试图以用户身份执行它 laxmikant 但是仍然得到了错误,那么,也许没有正确安装java。还要确保你设置了 JAVA_HOME 在hadoop的conf/hadoop-env.sh中正确。

相关问题