elasticsearch의 인덱스에 대한 change 여부를 체크하는 방법에 대한 포스트입니다.

1. 시퀀스 번호를 활용한 추적

시퀀스 번호 체크 방법

http://{ip}:9200/_search?seq_no_primary_term=true

Today this can be solved client side by storing the last sequence number and then polling the shard level stats for the current sequence number; if it is higher, there must have been a change. Closing.

마지막 시퀀스 번호를 저장 한 다음 현재 시퀀스 번호의 샤드 레벨 통계를 폴링하여 클라이언트 측에서 해결할 수 있습니다.

https://github.com/elastic/elasticsearch/issues/13830

Determine if the index has been modified · Issue #13830 · elastic/elasticsearch

Today, it is difficult to determine if any index has been updated (e.g., in mostly read only scenarios where the answer becomes more interesting). If you have a simple, outside cache, then it would...

github.com

2. 스택 모니터링의 indices stats 정보, index stats API  히스토리컬 데이터 확인

http://{ip}:9200/_stats

 

http://{ip}:9200/{index}/_stats

https://www.elastic.co/guide/en/kibana/7.5/elasticsearch-metrics.html#indices-overview-page

https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-stats.html

반응형

+ Recent posts