elasticsearch6设置默认分片数和副本数

elasticsearch6设置索引的默认分片数和副本数已经不是在elasticsearch.yml文件中了,而是使用了一个索引模板的东西

curl -XPUT 'http://10.27.12.16:9200/_template/template_http_request_record' -H 'Content-Type: application/json' -d '{"index_patterns": ["record_*"],"settings": {"number_of_shards": 1,"number_of_replicas": 0}}'

{
"index_patterns": ["record_*"],  #这个是作用于所有以record_开头的索引
"settings": {  #配置信息
"number_of_shards": 1,
"number_of_replicas": 0
}
}

 

posted @ 2019-04-17 16:57  一个和🔥有缘的人  阅读(5836)  评论(0编辑  收藏  举报