我正在 Windows 上运行地图缩减作业,它给了我这个错误。指定容器启动出现异常。
Stack trace: ExitCodeException exitCode=1: '/tmp/hadoop-user' is not
recognized as an internal or external command,
operable program or batch file.
at org.apache.hadoop.util.Shell.runCommand(Shell.java:972)
at org.apache.hadoop.util.Shell.run(Shell.java:869)
at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:1170)
at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:236)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:305)
at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:84)
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 1
我在命令提示符中的输入是:hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.8.2.jar wordcount /user/hadoop/ 输出 如何解决这个问题?
我相信第一步是创建一个输入文件,比如
/user/data/intestfile.txt
。那么命令应该是:
$ hadoop jar $HADOOP_HOME/share/hadoop/mapreduce/hadoop-mapreduce-examples-2.3.0.jar wordcount /user/data/testfile.txt /temp/output
其中
$HADOOP_HOME
= 指向 hadoop 安装目录的环境变量。您可以将其替换为完整目录路径。
/test/output
= 这是输出位置。确保它可访问且可写。此外,输出文件夹不应已存在于 /tmp
文件夹中。程序在运行时创建它。
我刚刚执行了命令,运行良好。