การจัดการวงจรชีวิตดัชนี (ILM)
เชี่ยวชาญการจัดการวงจรชีวิตดัชนีเพื่อทำให้การเปลี่ยนดัชนี สถาปัตยกรรมร้อน-อุ่น-เย็น และการเก็บรักษาเป็นอัตโนมัติ เพื่อให้ดัชนีล็อกทำงานรวดเร็วและควบคุมพื้นที่จัดเก็บได้
การจัดการวงจรชีวิตดัชนี (ILM) เป็นบทเรียน System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) ฟรีบน CoddyKit นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) มีบทเรียนทั้งหมด 4 บทเรียน
บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ
Why Manage Index Lifecycle?
Time-series data like logs grows endlessly. Index Lifecycle Management (ILM) automates moving, shrinking, and deleting indices so old data does not crush your cluster.
Rollover
Rollover creates a new index when the current one hits a size, age, or document count threshold. Writes always go to a single alias.
rollover:
max_size: 50gb
max_age: 1d
max_docs: 100000000Write Aliases
Apps write to an alias such as logs-write. ILM swaps which physical index the alias points to on rollover, invisible to the writer.
POST logs-write/_doc
{ "message": "..." }The Phases
ILM defines lifecycle phases a data ages through.
- Hot: actively written and queried
- Warm: read-only, queried less
- Cold: rarely queried, cheap storage
- Delete: removed
Hot Phase
The hot phase lives on the fastest nodes with the most resources, handling all writes and recent queries.
phases:
hot:
actions:
rollover: { max_age: 1d }Warm Phase
In warm, indices become read-only and may move to cheaper nodes. You can shrink shards and force-merge segments to save space.
warm:
min_age: 7d
actions:
forcemerge: { max_num_segments: 1 }
shrink: { number_of_shards: 1 }Cold and Frozen
Cold data moves to the cheapest disks; frozen can be searched directly from object storage. Both trade query speed for cost.
cold:
min_age: 30d
actions:
allocate: { require: { data: cold } }Delete Phase
The delete phase enforces retention by removing indices past a chosen age, the simplest way to cap storage growth.
delete:
min_age: 90d
actions:
delete: {}Attaching a Policy
An index template binds new indices to an ILM policy and the write alias automatically.
PUT _index_template/logs
{ "template": { "settings": {
"index.lifecycle.name": "logs-policy" } } }Node Roles
Hot-warm-cold relies on node attributes so allocation actions can route shards to the right hardware tier.
node.attr.data: hot # on fast nodes
node.attr.data: cold # on cheap nodesPutting It Together
A typical logging policy: roll over daily in hot, move to warm and force-merge after a week, go cold after a month, and delete after ninety days.
Quick Check
Pick the phase that enforces retention.
Recap
You learned how ILM automates index management: rollover starts fresh indices behind a write alias, and the hot-warm-cold-delete phases move data to cheaper tiers as it ages and finally remove it. Index templates bind policies automatically, keeping clusters fast and storage bounded.
เรียนรู้ System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) ด้วย AI tutor — ฟรี
เขียนและเรียกใช้โค้ดจริงในเบราว์เซอร์ของคุณ รับความช่วยเหลือทันทีจาก AI tutor 24/7 และเรียนรู้ต่อจากที่คุณหยุดบนเว็บหรือในแอป
- คอร์ส
- 12
- บทเรียน
- 48
คำถามที่พบบ่อย
บทเรียน “การจัดการวงจรชีวิตดัชนี (ILM)” ฟรีหรือไม่
ใช่ — ข้อความเต็มของ “การจัดการวงจรชีวิตดัชนี (ILM)” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) ให้อัปเกรดเป็น CoddyKit PRO คอร์ส System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) มีบทเรียนทั้งหมด 4 บทเรียน
คุณจะเรียนรู้อะไรในบทเรียน “การจัดการวงจรชีวิตดัชนี (ILM)”
เชี่ยวชาญการจัดการวงจรชีวิตดัชนีเพื่อทำให้การเปลี่ยนดัชนี สถาปัตยกรรมร้อน-อุ่น-เย็น และการเก็บรักษาเป็นอัตโนมัติ เพื่อให้ดัชนีล็อกทำงานรวดเร็วและควบคุมพื้นที่จัดเก็บได้ คุณปฏิบัติ System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน
คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) หรือไม่
ไม่จำเป็นต้องมีประสบการณ์มาก่อน System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน
บทเรียน “การจัดการวงจรชีวิตดัชนี (ILM)” ใช้เวลานานแค่ไหน
บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย
ฉันเขียนและรันโค้ดในบทเรียน System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) นี้ได้ไหม
ได้ บทเรียน System Observability: Logging, Metrics & Tracing (ELK + OpenTelemetry) ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ
บทเรียนทั้งหมดในหลักสูตรนี้
- ภาษาคำสั่ง Elasticsearch (DSL)
- ตัวกรองและกระบวนการประมวลผลของ Logstash
- Discover และ Lens ของ Kibana
- การจัดการวงจรชีวิตดัชนี (ILM)