'LifeCycle'에 해당되는 글 2건

  1. 2020.04.03 [Elasticsearch] Index 생성 시 Name Pattern
  2. 2020.03.16 [AWS] EC2 인스턴스 백업 하기

[Elasticsearch] Index 생성 시 Name Pattern

Elastic/Elasticsearch 2020. 4. 3. 11:22

Elastic Stack 을 사용하다 보면 Index 를 자동으로 생성 시켜 주는 설정들을 사용 하게 됩니다.

 

beats 에서는 output elasticsearch 사용 시 설정을 하게 되고,

logstash 에서도 output elasticsearch 사용 시 설정을 하게 됩니다.

 

보통 이 설정을 아래와 같이 하는데요.

 

Logstash)

index

- Value type is string
- Default value is "logstash-%{+YYYY.MM.dd}"

 

Beats)

index

The index name to write events to when you’re using daily indices. 
The default is "beat-%{[agent.version]}-%{+yyyy.MM.dd}" 
(for example, "beat-7.6.2-2020-04-02"). 
If you change this setting, you also need to configure the setup.
template.name and setup.template.pattern options (see Elasticsearch index template).

output.elasticsearch:
  hosts: ["https://localhost:9200"]
  index: "beats-%{[agent.version]}-%{+yyyy.MM.dd}"

- filebeat, metricbeat ...

 

보시면 아시겠지만, Daily rolling 으로 많이 사용하게 됩니다.

무조건 하루 단위로 생성이 되기 때문에 규모가 너무 작거나 너무 크거나 할 경우 효율이 떨어 질 수 밖에 없습니다.

그래서 Index Lifecycle Management 라는 기능을 Elasticsearch 에서 제공하고 있으니 활용 하시기 바랍니다.

 

여기서 문제)

그럼 output.elasticsearch.index 설정과 ilm 설정이 동시에 사용 중일 때 어떤 설정에 맞춰서 index 가 생성이 될까요?

 

정답)

ilm 설정이 우선 합니다. 

 

Elastic 의 공식 메시지는 이렇습니다.

https://www.elastic.co/guide/en/elasticsearch/reference/current/index-lifecycle-management.html

 

You can configure index lifecycle management (ILM) policies to automatically manage indices according to your performance, resiliency, and retention requirements.

 

:

[AWS] EC2 인스턴스 백업 하기

Cloud&Container/AWS 2020. 3. 16. 17:03

내부에서 사용하는 EC2 인스턴스의 경우 HA 구성까지는 너무 오버라고 생각될 때 최소한의 Backup 정책 정도는 만들어 놓는게 좋습니다.

 

Case 1) 임의 수동 Snapshot 생성

Backup 하고자 하는 Instance 에서 우클릭 후 Snapshot 생성 을 선택 하시면 됩니다.

Selected Instance -> Right Click -> Image -> Create Image

이와 같이 하면 IMAGES 매뉴에서 AMIs  에 생성된 이미지를 보실 수 있습니다.

 

Case 2) 주기적인 자동 Snapshot 생성 (EBS)

EC2 화면에서 수명 주기 관리자(Lifecycle Manager)

Create Snapshot Lifecycle Policy 를 선택해서 필요한 Scheduler 를 만듭니다.

자세한 내용이 궁금한 분들은 공홈 문서를 보시면 좋을 것 같습니다.

https://docs.aws.amazon.com/ko_kr/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html

https://docs.aws.amazon.com/ko_kr/AWSEC2/latest/UserGuide/ebs-creating-snapshot.html

: