[elasticsearch 5] java.lang.IllegalArgumentException: node settings must not contain any index level settings 에러
카테고리 없음 2017. 5. 26. 10:18일래스틱서치 5.0부터 elasticsearch.yml에 index.routing.allocation.total_shards_per_nod 속성을 저장할 수 없다.
elasticsearch.yml에 index.routing.allocation.total_shards_per_node 속성을 설정하려 한다면 일래스틱서치 노드의 로그 파일에서 다음과 같은 에러가 나타날 것이다.
[2017-05-25T20:32:09,248][WARN ][o.e.c.s.SettingsModule ] [5OEGj_a]
*************************************************************************************
Found index level settings on node level configuration.
Since elasticsearch 5.x index level settings can NOT be set on the nodes
configuration like the elasticsearch.yaml, in system properties or command line
arguments.In order to upgrade all indices the settings must be updated via the
/${index}/_settings API. Unless all settings are dynamic all indices must be closed
in order to apply the upgradeIndices created in the future should use index templates
to set default values.
Please ensure all required values are updated on all indices by executing:
curl -XPUT 'http://localhost:9200/_all/_settings?preserve_existing=true' -d '{
"index.routing.allocation.total_shards_per_node" : "4"
}'
*************************************************************************************
인덱스이름/_settings api를 동적으로 호출해 노드 당 전체 샤드 개수를 설정할 수 있다.
$ curl -XPUT 'localhost:9200/person/_settings' -d '{
"index.routing.allocation.total_shards_per_node": "4"
}'
잉ㄹ래스틱서치의 예외에서 나온 내용처럼 모든 인덱스에 대한 설정을 수정하려면 다음처럼 호출할 수 있다.
curl -XPUT 'http://localhost:9200/_all/_settings?preserve_existing=true' -d '{
"index.routing.allocation.total_shards_per_node" : "4"
}'