zoukankan      html  css  js  c++  java
  • HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}

    ====================================================================================================================

    hadoop集群部署上后,在服务器中运行hadoop自带的jar包中的实例报错

    HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}

    ====================================================================================================================

    异常一:
    2018-01-09 03:25:37,250 INFO mapreduce.Job: Job job_1515468264727_0001 failed with state FAILED due to: Application application_1515468264727_0001 failed 2 times due to AM Container for appattempt_1515468264727_0001_000002 exited with exitCode: 1
    Failing this attempt.Diagnostics: [2018-01-09 03:25:36.447]Exception from container-launch.
    Container id: container_1515468264727_0001_02_000001
    Exit code: 1


    [2018-01-09 03:25:36.499]Container exited with a non-zero exit code 1. Error file: prelaunch.err.
    Last 4096 bytes of prelaunch.err :
    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.env</name>
    <value>HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}</value>
    </property>
    解决方法:按错误提示,在mapred-site.xml配置文件中添加hadoop根目录
    1.先运行hadoop classpath得到classpath

    将得到的classpath全部复制到mapred-site.xml中,配置

    <property>
    <name>yarn.app.mapreduce.am.env</name>
    <value>HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}(将这一串红字用得到的classpath代替)</value>
    </property>
    <property>
    <name>mapreduce.map.env</name>
    <value>HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}(将这一串红字用得到的classpath代替)</value>
    </property>

    <property>
    <name>mapreduce.reduce.env</name>
    <value>HADOOP_MAPRED_HOME=${full path of your hadoop distribution directory}(将这一串红字用得到的classpath代替)</value>
    </property>

    配置结束关闭mapred-site.xml

    重新启动集群,再在share文件中运行

    得到结果:

     测试成功!!

  • 相关阅读:
    POJ 1703 Find them, Catch them (数据结构-并查集)
    ProductHunt:创业公司产品猎场和秀场
    firedac数据集控件的公共祖先类——TFDAdaptedDataSet
    IDFTP连不上FTP服务器的解决方法
    SQLServer到底支持多少连接数的并发?
    日志
    权限
    DATASNAP中间件调用带OUTPUT参数的存储过程
    连接池中的连接超过数据库端的最大空闲时间
    firedac的TFDStoredProc动态创建并调用存储过程
  • 原文地址:https://www.cnblogs.com/sea520/p/13539286.html
Copyright © 2011-2022 走看看