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
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。