【问题标题】:hadoop pagerank error when runninghadoop pagerank运行时出错
【发布时间】:2017-12-01 18:55:00
【问题描述】:

我已经在我的 vmware 上安装了 hadoop 并设计了我的 jar 文件 pagerank。运行以下命令:

hadoop jar PageRank-1.0.0.jar PageRankDriver init input output 2,出现如下错误;

Failing this attempt.Diagnostics: [2017-12-01 12:55:58.278]Exception from container-launch.
Container id: container_1512069161738_0011_02_000001
Exit code: 1
Stack trace: ExitCodeException exitCode=1: 
        at org.apache.hadoop.util.Shell.runCommand(Shell.java:994)
        at org.apache.hadoop.util.Shell.run(Shell.java:887)
        at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:1212)
        at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:295)
        at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.launchContainer(ContainerLaunch.java:457)
        at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:277)
        at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:90)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

[2017-12-01 12:55:58.278]
[2017-12-01 12:55:58.279]Container exited with a non-zero exit code 1. Last 4096 bytes of stderr :
Error: Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMaster

Please check whether your etc/hadoop/mapred-site.xml contains the below configuration:
<property>
  <name>yarn.app.mapreduce.am.env</name>
  <value>HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}</value>
</property>
<property>
  <name>mapreduce.map.env</name>
  <value>HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}</value>
</property>
<property>
  <name>mapreduce.reduce.e nv</name>
  <value>HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}</value>
</property>
[2017-12-01 12:55:58.279]
[2017-12-01 12:55:58.279]Container exited with a non-zero exit code 1. Last 4096 bytes of stderr :
Error: Could not find or load main class org.apache.hadoop.mapreduce.v2.app.MRAppMaster

Please check whether your etc/hadoop/mapred-site.xml contains the below configuration:
<property>
  <name>yarn.app.mapreduce.am.env</name>
  <value>HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}</value>
</property>
<property>
  <name>mapreduce.map.env</name>
  <value>HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}</value>
</property>
<property>
  <name>mapreduce.reduce.e nv</name>
  <value>HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}</value>
</property>
[2017-12-01 12:55:58.279]
For more detailed output, check the application tracking page: http://number9.cs.stevens.edu:8088/cluster/app/application_1512069161738_0011 Then click on links to logs of each attempt.
. Failing the application.
2017-12-01 12:55:59,219 INFO mapreduce.Job: Counters: 0
Init Job Error

有谁知道我该如何解决这个问题?

【问题讨论】:

    标签: java hadoop pagerank


    【解决方案1】:

    mapred-site.xml 中进行如下配置更改

    <configuration>
        <property>
            <name>mapreduce.framework.name</name>
            <value>yarn</value>
        </property>
        <property>
            <name>yarn.app.mapreduce.am.env</name>
            <value>HADOOP_MAPRED_HOME=${HADOOP_HOME}</value>
        </property>
        <property>
            <name>mapreduce.map.env</name>
            <value>HADOOP_MAPRED_HOME=${HADOOP_HOME}</value>
        </property>
        <property>
            <name>mapreduce.reduce.env</name>
            <value>HADOOP_MAPRED_HOME=${HADOOP_HOME}</value>
        </property>
    </configuration>
    

    【讨论】:

    • 我有同样的问题,我按照描述做了,但问题仍然存在
    • @HugoOshiro 尝试使用 stop-all.sh 停止所有 hadoop 守护程序,然后使用 start-all.sh 重新启动它们,然后它对我有用。
    • @HugoOshiro 此外,您应该已经在 bash 配置文件(.bashrc 或 .bash_profile)中定义了 HADOOP_HOME。喜欢export HADOOP_HOME="/usr/local/hadoop"
    【解决方案2】:

    在编辑您需要重新启动所有服务后,上面的对我有用。

    使用:

    stop-all.sh
    start-all.sh
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-15
      相关资源
      最近更新 更多