축소(shrink) api 예제는 다음과 같다. 



간단한 인덱스를 하나 생성한다.


$ curl -XPUT "http://localhost:9200/source_index"



특정 노드에 shrink를 실행한다. 모든 저장(index.blocks.write)을 막는다.


$ curl -XPUT "http://localhost:9200/source_index/_settings" -d'

{

  "settings": {

    "index.routing.allocation.require._name": "노드 이름", 

    "index.blocks.write": true 

  }

}'





원본 인덱스는 다음 커맨드를 사용해 target_index라는 새로운 인덱스로 축소한다.

$ curl -XPOST 'localhost:9200/source_index/_shrink/target_index?pretty'


모니터링은 _cat/recovery 엔드 포인트를 사용한다.


$ curl -XGET localhost:9200/_cat/recovery


Posted by '김용환'
,