1. 程式人生 > 其它 >spark+hadoop錯誤相關記錄

spark+hadoop錯誤相關記錄

spark+hadoop錯誤相關記錄:

錯誤1:java.lang.Exception: Unknown container. Container either has not started ...Yarn

  • 在我通過執行spark提交yarn任務,在hadoop平臺檢視日誌報錯java.lang.Exception: Unknown container. Container either has not started ...Yarn

  • 在yarn-site.xml配置 注意每個節點都要配置

            <property>
                    <name>mapreduce.jobhistory.address</name>
                    <value>linux01:10020</value>
            </property>
            <property>
                    <name>mapreduce.jobhistory.webapp.address</name>
                    <value>linux01:19888</value>
            </property>
    

    linux01為master節點名字

  • 在hadoop 的sbin 目錄下執行命令

    mr-jobhistory-daemon.sh start historyserver
    
  • 通過jps檢視可以看到

    JobHistoryServer
    

錯誤2:Caused by: org.apache.hadoop.yarn.exceptions.YarnException: Unauthorized request to start container. This token is expired. current time is ....

  • 這個提示token過期問題,很有可能是叢集中的時間不統一造成的:

    # 我發現叢集中的一臺機器是EDT型別,更改EDT為CST具體操作
    mv /etc/localtime /etc/localtime.bak
    ln -s /usr/share/zoneinfo/Asia/Shanghai  /etc/localtime
    date
    
  • 時間同步 每臺機器都執行

    yum install ntpdate -y
    ntpdate time.windows.com