1 Star 0 Fork 0

木易/elasticsearch-definitive-guide

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
10_Settings.asciidoc 1.71 KB
一键复制 编辑 原始数据 按行查看 历史

Index Settings

There are many many knobs that you can twiddle to customize index behavior, which you can read about in the {ref}/index-modules.html[Index Modules reference documentation], but…​

Tip
Elasticsearch comes with good defaults. Don’t twiddle these knobs until you understand what they do and why you should change them.

Two of the most important settings are as follows:

number_of_shards

The number of primary shards that an index should have, which defaults to 5. This setting cannot be changed after index creation.

number_of_replicas

The number of replica shards (copies) that each primary shard should have, which defaults to 1. This setting can be changed at any time on a live index.

For instance, we could create a small index—​just one primary shard—​and no replica shards with the following request:

PUT /my_temp_index
{
    "settings": {
        "number_of_shards" :   1,
        "number_of_replicas" : 0
    }
}

Later, we can change the number of replica shards dynamically using the update-index-settings API as follows:

PUT /my_temp_index/_settings
{
    "number_of_replicas": 1
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yangguilong/elasticsearch-definitive-guide.git
git@gitee.com:yangguilong/elasticsearch-definitive-guide.git
yangguilong
elasticsearch-definitive-guide
elasticsearch-definitive-guide
master

搜索帮助