عرض عملي: توسيع خدمة المخزون إلى ثلاث نسخ
في هذا الدرس 3 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
scale out behind Compose DNS and watch a replica die. Prepares MID-036-LAB1.
تفاصيل المخطط المبدئي
خطوة بخطوة
- Start Shop with
docker compose up --scale inventory=3; remove fixed host port mappings frominventory. - Call
inventoryfromordersrepeatedly and log the replica's hostname; show requests spread across three. - Run a load test; kill one replica mid-run.
- Planned mistake: hard-code one replica's IP in
ordersconfig. When that replica dies, every call fails. Fix: use the service name. - Show errors limited to requests in flight on the killed replica; explain why (already sent, not yet rerouted) and how retries on idempotent calls plus graceful shutdown reduce it.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.