我是 Hadoop 新手,正在尝试运行第一个简单的“字数统计”示例。我遇到了这里报告的相同问题(但那里的响应没有解决问题): Could not run jar file in hadoop3.1.3
Java 安装到 c:\jdk-15,并在 hadoop-env.cmd 文件中正确配置,如下所示:
@rem The java implementation to use. Required.
set JAVA_HOME=c:\jdk-15
正如您从下面的完整命令提示转储中看到的那样,我收到以下错误。如果有人能猜出这里可能出了什么问题,或者有任何其他建议,我将不胜感激。
“启动容器”[2020-09-30 15:17:56.848]容器以非零退出代码 1 退出。stderr 的最后 4096 个字节:'"C:\jdk-15"' 未被识别为内部或外部命令、可运行程序或批处理文件。
PS C:\hadoop-3.2.1\bin> hadoop jar ..\..\Hadoop\WordCount\wc.jar WordCount /test /WordCount/run1
2020-09-30 15:17:51,675 INFO client.RMProxy: Connecting to ResourceManager at /0.0.0.0:8032
2020-09-30 15:17:51,979 WARN mapreduce.JobResourceUploader: Hadoop command-line option parsing not performed. Implement the Tool interface and execute your application with ToolRunner to remedy this.
2020-09-30 15:17:52,052 INFO mapreduce.JobResourceUploader: Disabling Erasure Coding for path: /tmp/hadoop-yarn/staging/Admin/.staging/job_1601461031349_0008
2020-09-30 15:17:52,259 INFO sasl.SaslDataTransferClient: SASL encryption trust check: localHostTrusted = false, remoteHostTrusted = false
2020-09-30 15:17:52,426 INFO input.FileInputFormat: Total input files to process : 3
2020-09-30 15:17:52,592 INFO sasl.SaslDataTransferClient: SASL encryption trust check: localHostTrusted = false, remoteHostTrusted = false
2020-09-30 15:17:52,762 INFO sasl.SaslDataTransferClient: SASL encryption trust check: localHostTrusted = false, remoteHostTrusted = false
2020-09-30 15:17:52,829 INFO mapreduce.JobSubmitter: number of splits:3
2020-09-30 15:17:53,099 INFO sasl.SaslDataTransferClient: SASL encryption trust check: localHostTrusted = false, remoteHostTrusted = false
2020-09-30 15:17:53,190 INFO mapreduce.JobSubmitter: Submitting tokens for job: job_1601461031349_0008
2020-09-30 15:17:53,191 INFO mapreduce.JobSubmitter: Executing with tokens: []
2020-09-30 15:17:53,338 INFO conf.Configuration: resource-types.xml not found
2020-09-30 15:17:53,339 INFO resource.ResourceUtils: Unable to find 'resource-types.xml'.
2020-09-30 15:17:53,389 INFO impl.YarnClientImpl: Submitted application application_1601461031349_0008
2020-09-30 15:17:53,425 INFO mapreduce.Job: The url to track the job: http://CORSAIR:8088/proxy/application_1601461031349_0008/
2020-09-30 15:17:53,426 INFO mapreduce.Job: Running job: job_1601461031349_0008
2020-09-30 15:17:57,447 INFO mapreduce.Job: Job job_1601461031349_0008 running in uber mode : false
2020-09-30 15:17:57,448 INFO mapreduce.Job: map 0% reduce 0%
2020-09-30 15:17:57,460 INFO mapreduce.Job: Job job_1601461031349_0008 failed with state FAILED due to: Application application_1601461031349_0008 failed 2 times due to AM Container for appattempt_1601461031349_0008_000002 exited with exitCode: 1
Failing this attempt.Diagnostics: [2020-09-30 15:17:56.845]Exception from container-launch.
Container id: container_1601461031349_0008_02_000001
Exit code: 1
Shell output: 1 file(s) moved.
Setting up env variables
Setting up job resources
Copying debugging information
C:\tmp\hadoop-Admin\nm-local-dir\usercache\Admin\appcache\application_1601461031349_0008\container_1601461031349_0008_02_000001>rem Creating copy of launch script
C:\tmp\hadoop-Admin\nm-local-dir\usercache\Admin\appcache\application_1601461031349_0008\container_1601461031349_0008_02_000001>copy "launch_container.cmd" "C:/hadoop-3.2.1/logs/userlogs/application_1601461031349_0008/container_1601461031349_0008_02_000001/launch_container.cmd"
1 file(s) copied.
C:\tmp\hadoop-Admin\nm-local-dir\usercache\Admin\appcache\application_1601461031349_0008\container_1601461031349_0008_02_000001>rem Determining directory contents
C:\tmp\hadoop-Admin\nm-local-dir\usercache\Admin\appcache\application_1601461031349_0008\container_1601461031349_0008_02_000001>dir 1>>"C:/hadoop-3.2.1/logs/userlogs/application_1601461031349_0008/container_1601461031349_0008_02_000001/directory.info"
Launching container
[2020-09-30 15:17:56.848]Container exited with a non-zero exit code 1. Last 4096 bytes of stderr :
'"C:\jdk-15"' is not recognized as an internal or external command,
operable program or batch file.
[2020-09-30 15:17:56.848]Container exited with a non-zero exit code 1. Last 4096 bytes of stderr :
'"C:\jdk-15"' is not recognized as an internal or external command,
operable program or batch file.
For more detailed output, check the application tracking page: http://CORSAIR:8088/cluster/app/application_1601461031349_0008 Then click on links to logs of each attempt.
. Failing the application.
2020-09-30 15:17:57,477 INFO mapreduce.Job: Counters: 0
PS C:\hadoop-3.2.1\bin>`