إدارة دورة حياة الفهارس
أتمت انتقال الفهارس بين مراحل الساخن والدافئ والبارد والحذف باستخدام سياسات ILM للتحكم في التكلفة والأداء على نطاق واسع.
إدارة دورة حياة الفهارس درس مجاني في Elasticsearch & Full Text Search Systems على CoddyKit. هذا هو الدرس 4 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Elasticsearch & Full Text Search Systems، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Elasticsearch & Full Text Search Systems 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Data Gets Old
Time-based data like logs and metrics keeps growing. Recent data is queried constantly; old data rarely. Index Lifecycle Management (ILM) automates moving indices through phases so you spend resources only where they matter.
The Four Phases
ILM defines up to four phases:
- Hot: actively written and queried.
- Warm: no longer written, still queried.
- Cold: rarely queried, kept cheaply.
- Delete: removed.
Rollover
In the hot phase, rollover starts a fresh index when the current one hits a size, document count, or age limit. This keeps individual shards a manageable size.
"rollover": {
"max_size": "50gb",
"max_age": "7d"
}Defining a Policy
An ILM policy lists each phase and its min_age and actions. Here data moves to warm after 7 days and is deleted after 30.
PUT _ilm/policy/logs_policy
{
"policy": { "phases": {
"hot": { "actions": { "rollover": { "max_age": "1d" } } },
"warm": { "min_age": "7d", "actions": {} },
"delete": { "min_age": "30d", "actions": { "delete": {} } }
}}
}Warm Phase Actions
In warm you can shrink the index to fewer shards, forcemerge segments for query efficiency, and move shards to cheaper warm nodes via allocation.
"warm": {
"actions": {
"forcemerge": { "max_num_segments": 1 },
"shrink": { "number_of_shards": 1 }
}
}Cold and Frozen
The cold phase can store data as searchable snapshots on object storage, drastically cutting cost while keeping it queryable. The frozen tier takes this even further for archival data.
Attaching to an Index
A policy is linked to indices through an index template, so newly rolled-over indices inherit it automatically.
PUT _index_template/logs_template
{
"index_patterns": ["logs-*"],
"template": { "settings": {
"index.lifecycle.name": "logs_policy"
}}
}Data Streams
Data streams are the modern way to manage append-only time-series data with ILM. They hide rollover behind a single write alias, so you just index into the stream name.
Monitoring ILM
Use the explain lifecycle API to see which phase each index is in and whether any step is stuck or errored.
GET logs-*/_ilm/explainCost and Performance Wins
ILM lets hot data live on fast SSD nodes while old data drifts to cheap storage and is eventually deleted automatically. This is the backbone of cost-effective, large-scale time-series clusters.
Best Practices
Roll over on size to keep shards near 30-50 GB, forcemerge only once writes stop, test policies on a sample index, and always pair ILM with snapshots for true backups (delete is permanent).
Quick Check
Test your understanding of ILM.
Recap
You learned to automate index aging:
- ILM moves indices through hot, warm, cold, and delete phases by age.
- Rollover keeps shards manageable; warm actions shrink and forcemerge.
- Cold/frozen tiers use searchable snapshots for cheap storage.
- Attach policies via templates, use data streams for time-series, and pair ILM with real snapshots.
الأسئلة الشائعة
هل درس «إدارة دورة حياة الفهارس» مجاني؟
نعم — نص درس «إدارة دورة حياة الفهارس» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Elasticsearch & Full Text Search Systems، انتقل إلى CoddyKit PRO. تتضمن دورة Elasticsearch & Full Text Search Systems 4 دروس في المجموع.
ماذا ستتعلم في «إدارة دورة حياة الفهارس»؟
أتمت انتقال الفهارس بين مراحل الساخن والدافئ والبارد والحذف باستخدام سياسات ILM للتحكم في التكلفة والأداء على نطاق واسع. تتمرن على Elasticsearch & Full Text Search Systems مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Elasticsearch & Full Text Search Systems؟
لا تُشترط خبرة سابقة. Elasticsearch & Full Text Search Systems على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 4 من أصل 4.
كم من الوقت يستغرق درس «إدارة دورة حياة الفهارس»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Elasticsearch & Full Text Search Systems هذا؟
نعم. كل درس في Elasticsearch & Full Text Search Systems يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- إمكانات البحث الجغرافي المكاني
- إدارة بيانات السلاسل الزمنية
- استراتيجيات النشر في بيئة الإنتاج
- إدارة دورة حياة الفهارس