2015-12-27 92 views
0

我已经安装了Hadoop 2.7.1稳定版本。我遵循汤姆怀特的书以伪分布模式安装。我确实设置了像JAVA_HOME,HADOOP_HOME,PATH等所有环境变量。我配置了yarn-site.xml,hdfs-site.xml,core-site.xml,mapred-site.xml。Hadoop wordcount伪分布式模式错误退出代码:127

我使用以下命令复制了示例文件file.txt。

$hadoop fs -copyFromLocal textFiles/file.txt file.txt 

其示出了我

Found 2 items 
-rw-r--r-- 1 RAMA supergroup  3737 2015-12-27 21:52 file.txt 
drwxr-xr-x - RAMA supergroup   0 2015-12-27 22:17 input 

当我在Hadoop的MapReduce的例子-2.7.1.jar使用以下命令

RAMAs-MacBook-Pro:hadoop-2.7.1 RAMA$ hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.1.jar wordcount file.txt output 

它是扔我执行单词计数程序除了例外情况,我无法找到任何可行的解决方案。

15/12/27 22:41:52 WARN util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 
15/12/27 22:41:53 INFO client.RMProxy: Connecting to ResourceManager at localhost/127.0.0.1:8032 
15/12/27 22:41:53 INFO input.FileInputFormat: Total input paths to process : 1 
15/12/27 22:41:53 INFO mapreduce.JobSubmitter: number of splits:1 
15/12/27 22:41:53 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1451216397139_0020 
15/12/27 22:41:54 INFO impl.YarnClientImpl: Submitted application application_1451216397139_0020 
15/12/27 22:41:54 INFO mapreduce.Job: The url to track the job: http://192.168.1.6:8088/proxy/application_1451216397139_0020/ 
15/12/27 22:41:54 INFO mapreduce.Job: Running job: job_1451216397139_0020 
15/12/27 22:41:57 INFO mapreduce.Job: Job job_1451216397139_0020 running in uber mode : false 
15/12/27 22:41:57 INFO mapreduce.Job: map 0% reduce 0% 
15/12/27 22:41:57 INFO mapreduce.Job: Job job_1451216397139_0020 failed with state FAILED due to: Application application_1451216397139_0020 failed 2 times due to AM Container for appattempt_1451216397139_0020_000002 exited with exitCode: 127 
For more detailed output, check application tracking page:http://192.168.1.6:8088/cluster/app/application_1451216397139_0020Then, click on links to logs of each attempt. 
Diagnostics: Exception from container-launch. 
Container id: container_1451216397139_0020_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:266) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
at java.lang.Thread.run(Thread.java:745) 


Container exited with a non-zero exit code 127 
Failing this attempt. Failing the application. 
15/12/27 22:41:57 INFO mapreduce.Job: Counters: 0 

任何建议/意见有很大的帮助......

+0

您需要查看任务级别日志。 –

+0

打开http://192.168.1.6:8088/cluster/app/application_1451216397139_0020并检查它是什么意思? –

+0

Thnx杜尔加和杰克为您的建议。在检查任务级别日志后,我开始知道/ bin/java不存在。我已经完成了https://cloudcelebrity.wordpress.com/2014/01/31/yarn-job-problem-application-application_-failed-1-times-due-to-am-container-for-xx中提到的更改-exited与 - 退出码-127 /。但是,我必须在进行无根操作后执行这种更改。在更改“sudo ln -s/usr/bin/java/bin/java”后,我能够执行map-reduce程序。 – mmsr

回答

0

在hadoop-env.sh,明确加入JAVA_HOME变量Java主路径。