有没有办法在服务结构集群中的给定节点上共同部署一组无状态服务?
Is there a way to co-deploy a set of stateless services on a given node in service fabric cluster?
场景如下:
- 我有无状态服务 A、B、C 和 D。
- 我想将上述服务部署到 5 节点服务结构集群中。
- 我希望每个服务只有 3 个实例。 (我知道怎么做)。
- 我需要始终在给定节点上一起部署服务 A 和 C。 (Sidecar 模式)。
- 我不关心哪个特定节点可以同时拥有 A 和 C,只关心它们需要在一起。
有没有办法在服务结构集群中做到这一点?如果是这样,如何?一旦自动化,我不想在知道它们总是一起部署之后再考虑它。然而,我应该能够独立部署 A 或 C。
你可以看看service affinity。
引用自文档:
You can think of affinity as “pointing” one service at another and saying “This service can only run where that service is running.” Sometimes we refer to affinity as a parent/child relationship (where you point the child at the parent). Affinity ensures that the replicas or instances of one service are placed on the same nodes as those of another service.
场景如下:
- 我有无状态服务 A、B、C 和 D。
- 我想将上述服务部署到 5 节点服务结构集群中。
- 我希望每个服务只有 3 个实例。 (我知道怎么做)。
- 我需要始终在给定节点上一起部署服务 A 和 C。 (Sidecar 模式)。
- 我不关心哪个特定节点可以同时拥有 A 和 C,只关心它们需要在一起。
有没有办法在服务结构集群中做到这一点?如果是这样,如何?一旦自动化,我不想在知道它们总是一起部署之后再考虑它。然而,我应该能够独立部署 A 或 C。
你可以看看service affinity。
引用自文档:
You can think of affinity as “pointing” one service at another and saying “This service can only run where that service is running.” Sometimes we refer to affinity as a parent/child relationship (where you point the child at the parent). Affinity ensures that the replicas or instances of one service are placed on the same nodes as those of another service.