在Windows上的hadoop中启动容器时出错

时间:2018-02-15 17:56:03

标签: hadoop mapreduce

我在Windows上运行map reduce作业,它给了我这个错误。它指定容器启动时存在异常。

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 / output 如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

我认为第一步是创建一个输入文件,比如/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文件夹中。程序在运行时创建它。

我刚刚执行了命令,运行正常。