What statement is true regarding the Swarm service created by the following command? docker service create --name myweb --network webnet --mode global nginx
What statement is true regarding the Swarm service created by the following command? docker service create --name myweb --network webnet --mode global nginx
The correct answer is that the service runs exactly once on each node in a Swarm. The command uses the --mode global flag, which specifies that the service should run one instance on every node in the swarm. This ensures that the service will be present on each node rather than being replicated to an arbitrary number of instances or running only on nodes that provide a specific network.
it's "B" "Set service mode (--mode) The service mode determines whether this is a replicated service or a global service. A replicated service runs as many tasks as specified, while a global service runs on each active node in the swarm." see: https://docs.docker.com/engine/reference/commandline/service_create/#set-service-mode---mode
It’s B https://docs.docker.com/engine/swarm/services/#replicated-or-global-services
while a global service runs on each active node in the swarm. https://docs.docker.com/engine/reference/commandline/service_create/
https://docs.docker.com/engine/swarm/how-swarm-mode-works/services/ its B
The correct answer is D. The command docker service create --name myweb --network webnet --mode global nginx creates a Swarm service named "myweb" using the "nginx" image. The --network webnet option specifies that the service should be connected to the "webnet" overlay network. The --mode global option specifies that the service should run one replica per node, on all nodes which provide the "webnet" network. Therefore, the service runs on all nodes which provide the network "webnet". Option B is incorrect because the --mode global option ensures that the service runs once on each node that provides the specified network.