Recall & Review
beginner
What does scaling a service with replicas mean in Docker?
It means running multiple copies (replicas) of the same service to handle more work and improve availability.
Click to reveal answer
beginner
Which Docker command is used to scale a service to a specific number of replicas?
The command is
docker service scale <service_name>=<number_of_replicas>.Click to reveal answer
beginner
What happens if you scale a service down from 5 replicas to 2 replicas?
Docker stops 3 running containers of that service, leaving only 2 active replicas.
Click to reveal answer
beginner
How can you check the current number of replicas running for a Docker service?
Use
docker service ls to list services and see replicas, or docker service ps <service_name> for detailed tasks.Click to reveal answer
beginner
Why is scaling services with replicas useful in real life?
It helps handle more users or requests, keeps the service running if one replica fails, and improves speed by sharing the work.
Click to reveal answer
Which command scales a Docker service named 'webapp' to 4 replicas?
✗ Incorrect
The correct syntax to scale a service is
docker service scale <service_name>=<number>.What does increasing replicas of a service improve?
✗ Incorrect
More replicas mean more copies running, so the service can handle more users and stay available if some replicas fail.
If you run
docker service scale myservice=0, what happens?✗ Incorrect
Setting replicas to 0 stops all containers for that service but does not delete the service.
How do you see the number of replicas currently running for a service?
✗ Incorrect
docker service ls shows services with their replica counts.What is a replica in Docker service scaling?
✗ Incorrect
A replica is one running container instance of the service.
Explain how to scale a Docker service and why you would do it.
Think about running more copies of the same service.
You got /4 concepts.
Describe what happens behind the scenes when you increase the number of replicas for a service.
Imagine adding more workers to share the work.
You got /4 concepts.