ELK之es设置默认分片和副本数
LiuSw Lv6

ELK之es设置默认分片和副本数

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

linux 命令执行

1
2
3
4
curl -XPUT 'http://xxxxx:9200/_template/template_http_request_record'
-H 'Content-Type: application/json' -d
'{"index_patterns": ["*"],"settings": {"number_of_shards": 5,"number_of_replicas": 2}}'

json接口

1
2
3
4
5
6
7
8
_template/template_http_request_record
{
"index_patterns": \["\*"\],
"settings": {
"number_of_shards": 5,
"number_of_replicas": 2
}
}
  • index_patterns 这个是作用于索引匹配
  • number_of_shards 分片数量
  • number_of_replicas 副本数量

head插件查询

 评论