Skip to content
欢迎扫码关注公众号

指定 Elasticsearch 6 的默认分片数和副本数

ES6 及之后都是通过索引模板来实现这个功能的,但是 ES6 对应的 Kibana 上没有对应的页面,需要通过发送 HTTP 请求来设置。

网上大多是通过 curl 命令,可惜 Windows 中没有这个命令。

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

比较简单的替代是使用 VS Code 并安装 REST Client 插件,这个插件支持发送 HTTP 请求,并且能看到响应值。

新建一个 HTTP 格式的文件(后缀为 .http):

http
POST http://127.0.0.1:9200/_template/template_http_request_record
Content-Type: application/json

{
    "index_patterns": [
        "logstash-*"
    ],
    "settings": {
        "number_of_shards": 1,
        "number_of_replicas": 0
    }
}

参考

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

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.