빅데이터(BigData)/Spark

Container killed by YARN for exceeding physical memory limits 에러 발생 시

leebaro 2021. 3. 15.
728x90

spark submit 시 아래와 같은 에러가 발생할 수 있다.

 

원인은 executor에 할당된 메모리가 부족하다는 의미이다. 이 경우 executor의 할당된 메모리를 늘려주면 된다.

 

cluster.YarnScheduler: Lost executor 20 on xxx: Container killed by YARN for exceeding physical memory limits. 6 GB of 6 GB physical memory used. Consider boosting spark.executor.memoryOverhead.

 

아래와 같이 spark-submit  시 아래 옵션의 값을 변경해준다.

 

spark-submit --master yarn \

.....

--executor-memory 12g 

728x90