我已经安装了Hadoop 2.7.3稳定版。我设置了所有环境变量,如JAVA_HOME,HADOOP_HOME,PATH等。我配置了yarn-site.xml,hdfs-site.xml,core-site.xml,mapred-site.xml。
我在HDFS中上传了示例文件。当我使用下面的命令在hadoop-mapreduce-examples-2.7.3.jar中执行wordcount程序时
bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.7.3.jar grep input output 'as[a-z.]+'
它让我跟着异常。
17/01/28 00:59:33 INFO input.FileInputFormat: Total input paths to process : 36
17/01/28 00:59:33 INFO mapreduce.JobSubmitter: number of splits:36
17/01/28 00:59:33 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1485582326336_0001
17/01/28 00:59:34 INFO impl.YarnClientImpl: Submitted application application_1485582326336_0001
17/01/28 00:59:34 INFO mapreduce.Job: The url to track the job: http://XXXX.local:8088/proxy/application_1485582326336_0001/
17/01/28 00:59:34 INFO mapreduce.Job: Running job: job_1485582326336_0001
17/01/28 00:59:38 INFO mapreduce.Job: Job job_1485582326336_0001 running in uber mode : false
17/01/28 00:59:38 INFO mapreduce.Job: map 0% reduce 0%
17/01/28 00:59:38 INFO mapreduce.Job: Job job_1485582326336_0001 failed with state FAILED due to: Application application_1485582326336_0001 failed 2 times due to AM Container for appattempt_1485582326336_0001_000002 exited with exitCode: 127
For more detailed output, check application tracking page:http://XXXXXX.local:8088/cluster/app/application_1485582326336_0001Then, click on links to logs of each attempt.
Diagnostics: Exception from container-launch.
Container id: container_1485582326336_0001_02_000001
Exit code: 127
Stack trace: ExitCodeException exitCode=127:
at org.apache.hadoop.util.Shell.runCommand(Shell.java:582)
at org.apache.hadoop.util.Shell.run(Shell.java:479)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:773)
at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:212)
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.
17/01/28 00:59:38 INFO mapreduce.Job: Counters: 0
17/01/28 00:59:38 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8032
17/01/28 00:59:38 INFO mapreduce.JobSubmitter: Cleaning up the staging area /tmp/hadoop-yarn/staging/sumitdeshmukh/.staging/job_1485582326336_0002
org.apache.hadoop.mapreduce.lib.input.InvalidInputException: Input path does not exist: hdfs://localhost:9000/user/<username>/grep-temp-155204726
解决这个问题的方法是什么?
答案 0 :(得分:0)
问题出在java home上。 在hadoop-env.sh中,进行以下更改:
#export JAVA_HOME=${JAVA_HOME}
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home