/ bin / bash:/ bin / java:没有这样的文件或目录

我试图在Mac OS X EL Captain 10.11上使用Java 1.7

SDK和Hadoop2.7.1运行一个简单的单词计数MapReduce程序,并且在我的容器日志“ stderr” / bin /

bash中得到以下错误消息:/ bin / java:无此文件或目录

应用日志

5/11/27 02:52:33 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

15/11/27 02:52:33 INFO client.RMProxy: Connecting to ResourceManager at /192.168.200.96:8032

15/11/27 02:52:34 INFO input.FileInputFormat: Total input paths to process : 0

15/11/27 02:52:34 INFO mapreduce.JobSubmitter: number of splits:0

15/11/27 02:52:34 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1448608832342_0003

15/11/27 02:52:34 INFO impl.YarnClientImpl: Submitted application application_1448608832342_0003

15/11/27 02:52:34 INFO mapreduce.Job: The url to track the job: http://mymac.local:8088/proxy/application_1448608832342_0003/

15/11/27 02:52:34 INFO mapreduce.Job: Running job: job_1448608832342_0003

15/11/27 02:52:38 INFO mapreduce.Job: Job job_1448608832342_0003 running in uber mode : false

15/11/27 02:52:38 INFO mapreduce.Job: map 0% reduce 0%

15/11/27 02:52:38 INFO mapreduce.Job: Job job_1448608832342_0003 failed with state FAILED due to: Application application_1448608832342_0003 failed 2 times due to AM Container for appattempt_1448608832342_0003_000002 exited with exitCode: 127

For more detailed output, check application tracking page:http://mymac.local:8088/cluster/app/application_1448608832342_0003Then, click on links to logs of each attempt.

Diagnostics: Exception from container-launch.

Container id: container_1448608832342_0003_02_000001

Exit code: 127

Stack trace: ExitCodeException exitCode=127:

at org.apache.hadoop.util.Shell.runCommand(Shell.java:545)

at org.apache.hadoop.util.Shell.run(Shell.java:456)

at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:722)

at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:211)

at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:302)

at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:82)

at java.util.concurrent.FutureTask.run(FutureTask.java:262)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:745)

Container exited with a non-zero exit code 127

Failing this attempt. Failing the application.

15/11/27 02:52:38 INFO mapreduce.Job: Counters: 0

命令我正在运行

hadoop jar wordcount.jar org.myorg.WordCount /user/gangadharkadam/input/ /user/gangadharkadam/output/

我的ENV变量是-

export   JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_79.jdk/Contents/Home

export HADOOP_HOME=/usr/local/hadoop/hadoop-2.7.1

export HADOOP_MAPRED_HOME=/usr/local/hadoop/hadoop-2.7.1

export HADOOP_COMMON_HOME=/usr/local/hadoop/hadoop-2.7.1

export HADOOP_HDFS_HOME=/usr/local/hadoop/hadoop-2.7.1

export YARN_HOME=/usr/local/hadoop/hadoop-2.7.1

export HADOOP_CONF_DIR=/usr/local/hadoop/hadoop-2.7.1/etc/hadoop

export HADOOP_CLASSPATH=$JAVA_HOME/lib/tools.jar

export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:HADOOP_HOME/sbin:$M2_HOME/bin:$ANT_HOME/bin:$IVY_HOME/bin:$FB_HOME/bin:$MYSQL_HOME/bin:$MYSQL_HOME/lib:$SQOOP_HOME/bin

问题似乎是因为YARN对JAVA可执行文件使用的路径与您在OS中使用的路径不同。“ stderr”中失败任务的本地日志显示-/ bin / bash:/

bin / java:没有这样的文件或目录

我尝试从$ JAVA_HOM / bin / java到/ bin / java创建一个软链接,但在El Captian OS

X中创建了一个软链接,但不允许创建软链接。New OS X EL Captian具有无根登录名,用户无法在某些受限制的文件夹(例如/ bin

/)中创建任何内容。非常感谢您对此问题的任何解决。

回答:

该答案适用于Hadoop 2.6.0及更低版本。禁用SIP并创建符号链接确实提供了一种解决方法。更好的解决方案是修复hadoop-

config.sh,以使其正确接收您的JAVA_HOME

HADOOP_HOME/libexec/hadoop-config.sh看看下面的,如果条件# Attempt to set JAVA_HOME

if it is not set

删除导出JAVA_HOME行中的多余括号,如下所示。改变这个

if [ -x /usr/libexec/java_home ]; then

export JAVA_HOME=($(/usr/libexec/java_home))

else

export JAVA_HOME=(/Library/Java/Home)

fi

if [ -x /usr/libexec/java_home ]; then

// note that the extra parentheses are removed

export JAVA_HOME=$(/usr/libexec/java_home)

else

export JAVA_HOME=/Library/Java/Home

fi

进行此更改后,请重新启动纱线。

可以在这里找到更详细的信息https://issues.apache.org/jira/browse/HADOOP-8717,并且似乎Hadoop

3.0.0-alpha1是该修复程序的第一个发行版。

以上是 / bin / bash:/ bin / java:没有这样的文件或目录 的全部内容, 来源链接: utcz.com/qa/424446.html

回到顶部