Bird
0
0

A microservice is failing to connect to another service using its hardcoded IP address. What is the most likely cause and fix?

medium📝 Analysis Q14 of 15
Microservices - Orchestration with Kubernetes
A microservice is failing to connect to another service using its hardcoded IP address. What is the most likely cause and fix?
AIP address changed; use service discovery instead of hardcoding
BService is down; restart the service
CNetwork cable unplugged; check physical connections
DFirewall blocking traffic; disable firewall
Step-by-Step Solution
Solution:
  1. Step 1: Identify problem with hardcoded IP

    Hardcoded IPs break when services move or scale, causing connection failures.
  2. Step 2: Recommend dynamic service discovery

    Using service discovery allows services to find current addresses dynamically, fixing the issue.
  3. Final Answer:

    IP address changed; use service discovery instead of hardcoding -> Option A
  4. Quick Check:

    Hardcoded IP failure = use service discovery [OK]
Quick Trick: Avoid hardcoded IPs; use service discovery [OK]
Common Mistakes:
MISTAKES
  • Restarting services without checking addresses
  • Ignoring dynamic environment changes
  • Disabling firewall without cause

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes