시계열 데이터 관리
데이터 스트림, ILM(색인 수명 주기 관리), 핫-웜-콜드 아키텍처를 포함한 시계열 데이터에 맞게 Elasticsearch를 최적화합니다.
시계열 데이터 관리은(는) CoddyKit의 무료 Elasticsearch & Full Text Search Systems 강의입니다. 이것은 4개 중 2번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Elasticsearch & Full Text Search Systems 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Elasticsearch & Full Text Search Systems 강의에는 총 4개의 강의가 포함되어 있습니다.
이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.
What is Time-Series Data?
Time-series data is information collected over a period of time, often at regular intervals. Think of it as a sequence of data points indexed by time.
Examples include:
- System logs: Events happening on a server.
- IoT sensor readings: Temperature, humidity from devices.
- Financial data: Stock prices over days or hours.
This data is typically append-only and usually immutable once recorded.
Why Elasticsearch for Time-Series?
Elasticsearch is an excellent choice for managing time-series data due to its:
- Scalability: Handles massive volumes of data.
- Speed: Fast indexing and search capabilities.
- Analytics: Powerful aggregations for insights.
- Flexibility: Can store structured and unstructured data.
It's particularly strong for use cases like log analytics, metric monitoring, and security event management.
Introducing Data Streams
Data streams are a core feature in Elasticsearch designed specifically for time-series data. They simplify management by automatically rolling over to new indices as needed.
When you index data into a data stream, it always writes to the current write index. Queries, however, search across all backing indices transparently. This makes managing large, continuously growing datasets much easier.
Creating Your First Data Stream
To create a data stream, you first need an index template that defines its structure and points to a data stream.
Then, simply indexing a document into the stream's name will create it automatically based on the template:
PUT _index_template/my-data-stream-template
{
"index_patterns": ["my-data-stream-*"],
"data_stream": {},
"priority": 200,
"template": {
"settings": {
"number_of_shards": 1
},
"mappings": {
"properties": {
"@timestamp": {
"type": "date",
"format": "strict_date_optional_time||epoch_millis"
},
"message": { "type": "text" }
}
}
}
}
// Indexing a document creates the stream
POST my-data-stream/_doc
{
"@timestamp": "2023-10-27T10:00:00Z",
"message": "Sensor reading: 25.5C"
}Automating with ILM
Index Lifecycle Management (ILM) is a powerful feature that automates the management of your indices through various phases of their life.
For time-series data, ILM helps you:
- Automatically roll over indices when they reach a certain size or age.
- Move older, less frequently accessed data to cheaper storage.
- Delete data that is no longer needed.
The Four ILM Phases
ILM policies define actions for indices across four main phases:
- Hot: Indices are actively being written to and frequently queried. Requires fast storage.
- Warm: Indices are no longer being written to, but are still queried. Can be read-only and potentially on slower storage.
- Cold: Indices are rarely queried and often stored on very cheap, slow storage.
- Delete: Indices are no longer needed and are safely removed from the cluster.
Crafting an ILM Policy
Here's an example of an ILM policy that defines rollover, forcemerge (for warm phase), and deletion stages for time-series data:
PUT _ilm/policy/my-ts-policy
{
"policy": {
"phases": {
"hot": {
"actions": {
"rollover": {
"max_age": "7d",
"max_docs": 10000000,
"max_size": "50gb"
}
}
},
"warm": {
"min_age": "30d",
"actions": {
"forcemerge": {
"max_num_segments": 1
},
"shrink": {
"number_of_shards": 1
}
}
},
"cold": {
"min_age": "90d",
"actions": {
"freeze": {}
}
},
"delete": {
"min_age": "180d",
"actions": {
"delete": {}
}
}
}
}
}Hot-Warm-Cold Architecture
A Hot-Warm-Cold architecture optimizes resource utilization and cost for time-series data by using different types of nodes for different ILM phases.
- Hot nodes: Use fast CPUs, SSDs for high indexing and query throughput.
- Warm nodes: Use less powerful CPUs, HDDs (or slower SSDs) for older, read-only data.
- Cold nodes: Use very cheap, high-capacity storage, potentially even object storage, for rarely accessed data.
Assigning Node Roles
You can configure nodes to serve specific roles (hot, warm, cold) by setting node.attr in their elasticsearch.yml configuration file.
ILM policies then use these attributes to automatically move indices to the appropriate node types as they transition through phases.
# For a hot node
node.roles: [ data ]
node.attr.data: hot
# For a warm node
node.roles: [ data ]
node.attr.data: warm
# For a cold node
node.roles: [ data ]
node.attr.data: coldILM & Data Stream Check
Which of the following statements about Elasticsearch's time-series features are TRUE?
Time-Series Recap
Great job! You've explored how Elasticsearch is optimized for time-series data.
We covered:
- Data Streams: Simplifying index management and rollovers.
- ILM (Index Lifecycle Management): Automating index transitions through hot, warm, cold, and delete phases.
- Hot-Warm-Cold Architectures: Optimizing cluster resources and costs by assigning different node types to specific ILM phases.
These features are essential for building scalable and cost-effective time-series solutions with Elasticsearch.
자주 묻는 질문
“시계열 데이터 관리” 강의는 무료인가요?
네 — “시계열 데이터 관리” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Elasticsearch & Full Text Search Systems 강의 전체를 잠금 해제할 수 있습니다. Elasticsearch & Full Text Search Systems 강의에는 총 4개의 강의가 포함되어 있습니다.
“시계열 데이터 관리”에서 뭘 배우나요?
데이터 스트림, ILM(색인 수명 주기 관리), 핫-웜-콜드 아키텍처를 포함한 시계열 데이터에 맞게 Elasticsearch를 최적화합니다. 브라우저에서 직접 실행하는 실습 코드로 Elasticsearch & Full Text Search Systems을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.
Elasticsearch & Full Text Search Systems을(를) 시작하는 데 경험이 필요한가요?
사전 경험은 필요하지 않습니다. CoddyKit의 Elasticsearch & Full Text Search Systems은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 2번째 강의입니다.
“시계열 데이터 관리” 강의는 얼마나 걸리나요?
대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.
이 Elasticsearch & Full Text Search Systems 강의에서 코드를 작성하고 실행할 수 있나요?
네. 모든 Elasticsearch & Full Text Search Systems 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.
이 강의의 모든 강의
- 지리 공간 검색 기능
- 시계열 데이터 관리
- 운영 환경 배포 전략
- 인덱스 수명 주기 관리