docker 全局服务和复制之间有什么区别,如何更改全局服务的数量?
what is the difference between docker global service and replicate, and how to change number of global services?
docker 服务 ls :
pclmy6i40arj consul_consul global 4/4 consul:latest
wr95np1xsqr0 consul_consul-agent global 4/4 consul:latest
我想更改全局服务的数量,怎么办?
在global
模式下,运行每个集群节点一个服务副本。全局副本的数量等于集群节点的数量。
在 replica
模式下,您可以 运行 任意数量的服务实例。
官方文档说:
For replicated services, you specify the number of replica tasks for the swarm manager to schedule onto available nodes. For global services, the scheduler places one task on each available node that meets the service’s placement constraints and resource requirements.
docker 服务 ls :
pclmy6i40arj consul_consul global 4/4 consul:latest
wr95np1xsqr0 consul_consul-agent global 4/4 consul:latest
我想更改全局服务的数量,怎么办?
在global
模式下,运行每个集群节点一个服务副本。全局副本的数量等于集群节点的数量。
在 replica
模式下,您可以 运行 任意数量的服务实例。
官方文档说:
For replicated services, you specify the number of replica tasks for the swarm manager to schedule onto available nodes. For global services, the scheduler places one task on each available node that meets the service’s placement constraints and resource requirements.