'warm'에 해당되는 글 1건

  1. 2015.12.10 [Elasticsearch] Shard Allocation Filtering 설정 시 주의사항. (on 2.1)

[Elasticsearch] Shard Allocation Filtering 설정 시 주의사항. (on 2.1)

Elastic/Elasticsearch 2015. 12. 10. 11:01

hot-warm architecture 구성시 경험했던 팁 공유 합니다.

아주 사소한 팁입니다.


원문링크)

https://www.elastic.co/guide/en/elasticsearch/reference/2.1/shard-allocation-filtering.html


index settings 기능을 이용해서 "index.routing.allocation.{attribute}.{attribute}" 설정을 하게 됩니다.

이 과정에서 사용하는 REST API 가 두 가지가 있습니다.


[_settings API]

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

{

    "index.routing.allocation.require.box_type":"warm"

}'


[Request body에 settings]

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

{

  "settings": {

    "index.routing.allocation.require.box_type":"warm"

  }

}'


개인적으로는 위 두 가지 방식이 다 동작해야 한다고 생각해서 실행을 시켰습니다.

해보시면 아시겠지만 아래 방식은 index_already_exists_exception 에러가 발생을 합니다.

Elasticsearch에 확인해본 결과로는 에러 메시지를 잘못 return 해준 경우라고 하내요. 즉, trivial 정도의 bug(?) 라고 봐도 될 것 같긴 합니다.

어쨌든 수정할 거라고 하니 나중에는 반영 되리라 기대 합니다.


그리고 http method 사용시 보시면 아시겠지만 PUT method 를 사용하셔야 합니다.

제가 POST 를 사용했는데요.

이 경우에는 PUT 을 사용하는게 맞다고 합니다.

제가 삽질한 이유가 되겠습니다. ㅡ.ㅡ;;

: