apache mesos中不同角色权重的意义是什么

What is the significance of weights for different roles in apache mesos

我想了解mesos中不同角色权重的概念。我为 role1 赋予了 2.0 的权重,为 role2 赋予了 5.0 的权重,并在 mesos 集群中启动了 spark 框架并要求相同数量的资源。我没有看到为这两个角色分配资源的方式有任何变化。所以我想知道赋予权重的重要性,并展示了使用权重进行资源预留的示例。

来自TYPED_TEST(MasterAllocatorTest, RebalancedForUpdatedWeights)

This test ensures that resource allocation is correctly rebalanced according to the updated weights.

  1. 启动 Mesos 管理节点。
  2. 注册三个具有相同资源的代理。
  3. 强制代理注册的提前时钟。
  4. 集群资源总数(3 个代理):cpus=6, mem=3072
  5. Framework1 向使用默认权重 (1.0) 的 role1 注册, 所有资源都将提供给这个框架,因为它是唯一的 框架 运行 到目前为止。
  6. Framework2role2 注册,它也使用默认权重。 由于所有资源都有未完成的优惠,因此不会获得任何优惠 注册时到 framework1。

    role1 share = 1 (cpus=6, mem=3072)
      Framework1 share = 1
    role2 share = 0
      Framework2 share = 0
    
  7. 预计要约已取消。

  8. role2 的权重更新为 2.0。 updateWeights将撤销所有未完成的offer,被撤销的offer资源仅对更新权重可用一次 另一个分配被调用。
  9. 触发批量分配。

    role1 share = 0.33 (cpus=2, mem=1024)
      Framework1 share = 1
    role2 share = 0.66 (cpus=4, mem=2048)
      Framework2 share = 1