الاكتشاف المبني على DNS
في هذا الدرس 4 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
use DNS names for service-to-service calls.
الموضوعات المخطط لها
- In Docker Compose, every service name is a DNS name on the Compose network:
http://inventory:8080. - With several replicas, the name resolves to the replicas' addresses (Docker's internal DNS rotates among them).
- Clients and JVMs may cache DNS results; check the JVM's DNS cache TTL and connection pooling (verify settings before recording).
- Pooled keep-alive connections stay on one replica until closed, which skews balancing.
- No library needed: configuration is just a hostname.
تفاصيل المخطط المبدئي
عرض عملي
services:
inventory:
image: shop/inventory
deploy: { replicas: 3 }
orders:
environment:
INVENTORY_URL: http://inventory:8080اختبر فهمك
What does orders need to know to reach inventory?
أظهر الإجابة
Only the name inventory and the port.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.