设置全局分片数量:
put http://196.168.137.100:9200/_template/template_http_request_record
{
“index_patterns”: ["*"],
“settings”: {
“number_of_shards”: 5,
“number_of_replicas”: 1
}
}
指定创建索引时的分片数量:
put http://196.168.137.100:9200/<索引名称>
{
“settings”: {
“number_of_shards”: 5,
“number_of_replicas”: 1
}
}
linux 命令执行
curl -XPUT 'http://xxxxx:9200/_template/template_http_request_record'
-H 'Content-Type: application/json' -d
'{"index_patterns": ["*"],"settings": {"number_of_shards": 1,"number_of_replicas": 0}}'
具体json
执行的接口
_template/template_http_request_record
参数
{
"index_patterns": ["*"], #这个是作用于索引匹配
"settings": { #配置信息
"number_of_shards": 1,
"number_of_replicas": 0 # 备份数量
}
}