Bird
0
0

What will happen if you deploy a Docker service with 3 replicas on a Swarm with 2 nodes?

medium📝 Command Output Q4 of 15
Docker - Swarm
What will happen if you deploy a Docker service with 3 replicas on a Swarm with 2 nodes?
ASwarm fails because replicas exceed nodes
BSwarm schedules 2 replicas on one node and 1 on the other
CAll replicas run on a single node only
DSwarm creates only 2 replicas automatically
Step-by-Step Solution
Solution:
  1. Step 1: Understand replica distribution in Swarm

    Swarm tries to spread replicas evenly across nodes.
  2. Step 2: Apply to 3 replicas and 2 nodes

    Two nodes will get 2 and 1 replicas respectively to balance load.
  3. Final Answer:

    Swarm schedules 2 replicas on one node and 1 on the other -> Option B
  4. Quick Check:

    Replica distribution = Balanced across nodes [OK]
Quick Trick: Swarm balances replicas across available nodes [OK]
Common Mistakes:
  • Thinking Swarm fails if replicas > nodes
  • Assuming all replicas run on one node

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes