HADOOP 3.2.1,的HA,装好之后,测试wordcount程序时报下面的错误

    1. For more detailed output, check the application tracking page: http://hadoop102:8088/cluster/app/application_1590917926429_0002 Then click on links to logs of each attempt.
    2. . Failing the application.
    3. 2020-05-31 17:44:08,998 INFO org.apache.hadoop.yarn.server.resourcemanager.rmapp.RMAppImpl: application_1590917926429_0002 State change from FINAL_SAVING to FAILED on event = APP_UPDATE_SAVED
    4. 2020-05-31 17:44:08,998 WARN org.apache.hadoop.yarn.server.resourcemanager.RMAuditLogger: USER=deploy OPERATION=Application Finished - Failed TARGET=RMAppManager RESULT=FAILURE DESCRIPTION=App failed with state: FAILED PERMISSIONS=Application application_1590917926429_0002 failed 2 times due to AM Container for appattempt_1590917926429_0002_000002 exited with exitCode: 1
    5. Failing this attempt.Diagnostics: [2020-05-31 17:44:08.952]Exception from container-launch.
    6. Container id: container_e31_1590917926429_0002_02_000001
    7. Exit code: 1
    8. [2020-05-31 17:44:08.959]Container exited with a non-zero exit code 1. Error file: prelaunch.err.
    9. Last 4096 bytes of prelaunch.err :
    10. Last 4096 bytes of stderr :
    11. log4j:WARN No appenders could be found for logger (org.apache.hadoop.mapreduce.v2.app.MRAppMaster).
    12. log4j:WARN Please initialize the log4j system properly.
    13. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
    14. [2020-05-31 17:44:08.961]Container exited with a non-zero exit code 1. Error file: prelaunch.err.
    15. Last 4096 bytes of prelaunch.err :
    16. Last 4096 bytes of stderr :
    17. log4j:WARN No appenders could be found for logger (org.apache.hadoop.mapreduce.v2.app.MRAppMaster).
    18. log4j:WARN Please initialize the log4j system properly.
    19. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.

    终极解决方案是修改yarn-site.xml,增加如下配置

    1. <!--新版本指定文件-->
    2. <property>
    3. <name>yarn.resourcemanager.webapp.address.rm1</name>
    4. <value>hadoop102</value>
    5. </property>
    6. <property>
    7. <name>yarn.resourcemanager.scheduler.address.rm2</name>
    8. <value>hadoop103</value>
    9. </property>
    10. <property>
    11. <name>yarn.resourcemanager.webapp.address.rm2</name>
    12. <value>hadoop103</value>
    13. </property>

    重启yarn,hdfs再测试,搞定。