zoukankan      html  css  js  c++  java
  • 解决CDH SparkStreaming任务启动之后executor不停增长的问题,num-executors配置不管用。

    spark2-submit --class SparkKafka  --master yarn --executor-memory 1G --num-executors 6 --driver-memory 1g 
    --conf spark.driver.supervise=true 
    --conf spark.dynamicAllocation.maxExecutors=6 
    --conf spark.streaming.kafka.maxRatePerPartition=100 recommend-1.0-SNAPSHOT.jar

    主要原因是spark.dynamicAllocation.maxExecutors这个配置,

    在CDH中,默认开启了动态资源占用,即资源如果空余时,SparkStreaming会自动按照并发度(并行的block数)来占用资源,而spark-streaming作为一个实时处理系统,在大多数时候是不需要太多资源的。

    为了限制spark streaming最多分配的executor数,可以配置spark.dynamicAllocation.maxExecutors为动态资源分配的上限。num-executors其实是资源初始化时所取的值,所以其实还是有用的。

    这里要注意的是开源是默认没有开启动态资源占用的,可以通过spark.dynamicAllocation.enabled=true这一配置来开启,如果配置了这一项,同时还需要开启external-shuffle-service,保证在动态回收不再工作的executor的时候不会中断在executor上的shuffle过程spark.shuffle.service.enabled=true。

    本配置调试的Spark版本为2.3.1

  • 相关阅读:
    GRYZ20211029模拟赛解题报告
    LG 题解 CF1545B AquaMoon and Chess
    GRYZ10.27模拟赛解题报告
    开博客通告
    民科吧编程赛 题解
    民科吧编程赛 试题
    四则运算开平方——对民科吧编程大赛题目的再探究
    The First
    机械手相机9点坐标标定-基于C#+EmguCV
    Emgucv图像处理工具
  • 原文地址:https://www.cnblogs.com/arli/p/9409982.html
Copyright © 2011-2022 走看看