resource offer 如何与 mesos 一起用于 spark streaming 应用程序?

how does resource offer works with mesos for a spark streaming application?

根据我阅读 mesos 文档的理解,资源提供是针对 application/framework 的,并且取决于应用程序是否提供 accept/reject。

我有一个 "never-ending" 火花流应用程序,我在其中配置了 executors/cores/memory 我需要并行性。这些资源不是在我的spark-app启动的时候才获取一次吗。也就是说,如果我的执行者闲置了,他们会被交还给 mesos 吗?

在 spark-streaming 的情况下,资源提供和接受是否只发生一次?

同样的问题可以扩展到其他 long-运行ning 框架,例如 mesos 上的 cassandra 或 YARN。

我的理解是,当 spark-streaming 在粗粒度模型上 运行 时,资源交换发生一次,并且资源在 spark 应用程序的生命周期内专用于执行程序

Mesos 上 Spark 的最佳来源是 the spark docs site here。 在粗粒度部分,您可以看到以下内容可以回答您的问题:

The benefit of coarse-grained mode is much lower startup overhead, but at the cost of reserving Mesos resources for the complete duration of the application. To configure your job to dynamically adjust to its resource requirements, look into Dynamic Allocation.

如果您查看 Dynamic resource allocation,您可能会通过 Spark Shuffle 服务移动执行程序资源。这可以通过 Spark 服务提供的脚本或通过 Marathon 来实现。