【问题标题】:How to make spark streaming process multiple batches?如何使火花流处理多批次?
【发布时间】:2018-07-09 18:18:37
【问题描述】:

Spark 使用并行性,但是在测试我的应用程序并查看 sparkUI 时,在流式处理选项卡下,我经常注意到在“活动批次”下,一个的状态是“正在处理”,其余的是“排队”。有没有我可以配置的参数让 Spark 同时处理多个批次?

注意:我使用的 spark.streaming.concurrentJobs 大于 1,但这似乎不适用于批处理 (?)

【问题讨论】:

    标签: scala apache-spark apache-kafka spark-streaming


    【解决方案1】:

    我想你正在使用 Yarn 来启动你的火花流。

    Yarn 将您的批次排队,因为他没有足够的资源来同时启动您的流/火花批次。

    您可以尝试通过以下方式限制纱线使用资源:

    -driver-memory -> memory for the driver
    --executor-memory -> memory for worker
    -num-executors -> number of distinct yarn containers
    --executor-cores -> number of threads you get inside each executor
    

    例如:

    spark-submit \
    --master yarn \
    --deploy-mode cluster \
    --driver-memory 800m \
    --executor-memory 800m \
    --num-executors 4 \
    --class my.class \
    myjar
    

    【讨论】:

    • 你说得对,我正在使用 YARN。我运行的环境有很多资源,但是我确实尝试降低执行程序的内存使用量,但这没有影响。我仍然得到越来越多的“排队”批处理列表。
    • 尝试将 --executor-memory 增加到 5GB 并包含 --executor-cores 4 或任何数字以增加执行器内的并行度。别忘了给spark.yarn.executor.memoryOverhead
    猜你喜欢
    • 2016-06-25
    • 2015-12-17
    • 1970-01-01
    • 2016-10-02
    • 1970-01-01
    • 2020-11-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多