본문 바로가기
ElasticSearch

ElasticSearch primary shard 할당 에러

by Rainbound-IT 2022. 9. 6.
반응형

 

curl -X PUT "localhost:9200/shard_index?pretty" -H 'Content-Type: application/json' -d'
> {
>  "index.number_of_shard": 5
> }
> '

 

인덱스 생성하면서 샤드 설정해주는데 다음과 같은 에러 발생

 

elasticsearch unknown key [index.number_of_shards] for create index curl

 

원인은 버전업이 되서 api 가 변경된것같음

 

 

 

다음과 같이 settings 를 넣어줘야함

curl -X PUT "localhost:9200/shard_index?pretty" -H 'Content-Type: application/json' -d'
{
 "settings": {
  "index": {
   "number_of_shards":2
   }
  }
}
'

 

 

 

 

 

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

 

Create index API | Elasticsearch Guide [8.4] | Elastic

You do not have to explicitly specify index section inside the settings section.

www.elastic.co

 

반응형

댓글