2017-04-15 266 views
5

我跑Hadoop的2.7.0,但MapReduce工作一個MapReduce工作無法啓動,我碰到這樣的波紋管錯誤:申請失敗2次,由於AM容器:使用退出碼退出:1

Job job_1491779488590_0002 failed with state FAILED due to: Application application_1491779488590_0002 failed 2 times due to AM Container for appattempt_1491779488590_0002_000002 exited with exitCode: 1 
For more detailed output, check application tracking page:http://erfan:8088/cluster/app/application_1491779488590_0002Then, click on links to logs of each attempt. 
Diagnostics: Exception from container-launch. 
Container id: container_1491779488590_0002_02_000001 
Exit code: 1 
Stack trace: ExitCodeException exitCode=1: 
    at org.apache.hadoop.util.Shell.runCommand(Shell.java:545) 
    at org.apache.hadoop.util.Shell.run(Shell.java:456) 
    at org.apache.hadoop.util.Shell$ShellCommandExecutor.execute(Shell.java:722) 
    at org.apache.hadoop.yarn.server.nodemanager.DefaultContainerExecutor.launchContainer(DefaultContainerExecutor.java:211) 
    at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:302) 
    at org.apache.hadoop.yarn.server.nodemanager.containermanager.launcher.ContainerLaunch.call(ContainerLaunch.java:82) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) 
    at java.lang.Thread.run(Thread.java:745) 


Container exited with a non-zero exit code 1 
Failing this attempt. Failing the application. 
17/04/10 13:40:08 INFO mapreduce.Job: Counters: 0 

這個錯誤的原因是什麼?我該如何解決這個問題?

任何幫助表示讚賞。

+0

您的應用程序掌握您的工作未能開始。嘗試檢查紗線日誌以獲取更詳細的信息。 '紗線日誌-applicationId APP_ID' – jeff

+0

謝謝,我寫了這個命令,但我面對這個消息是什麼意思?用法:yarn [options] yarn:error:no such option:-a –

+0

請將您試圖運行的命令添加到您的問題中 – jeff

回答

1

您可以查看實際問題的應用程序日誌。

爲此,您可以打開NameNode的Web界面 namenode_ip:50070
在這裏你可以看到瀏覽選項,點擊它。
在子菜單中,選擇日誌。
現在選擇用戶日誌。

在這裏您可以看到您運行的應用程序列表。

打開鏈接application_1491779488590_0002爲你的上述作業裏面你可以看到每個地圖的日誌&減少任務。 打開地圖/縮小作業日誌鏈接。

在裏面你可以看到:sys,error,stdout files。 從這些日誌文件中,你可以得到實際的錯誤,並且可以修復它。

或者您在 $ HADOOP_HOME/logs/userlogs/application_id路徑中看到這些日誌。

應用程序失敗2次,因爲如果應用程序主控因爲某種原因失敗,默認情況下它會嘗試再次執行應用程序。 AM重試屬性可以設置爲1以避免這種情況。