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
}
}

05-23 11:04