2.X/1. Getting Started

1-10-03. Index Settings

drscg 2017. 9. 30. 17:27

There are many many knobs that you can twiddle to customize index behavior, which you can read about in the Index Modules reference documentation, but…

index의 동작을 조절하기 위한, 아주 많은 변수가 있다. Index Modules reference documentation에서 참고할 수 있다. 그러나…

Tip

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

Elasticsearch는 좋은 기본값을 가지고 있다. 그것이 무슨 동작을 하는지, 왜 그것을 변경해야 하는지를 이해할 때까지, 변수들을 변경하지 않기를 바란다.

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.

index가 가져야 하는 primary shard의 수, 기본값은 5, 이 설정은 index를 생성된 후에는 변경할 수 없다.

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.

각 primary shard가 가져야 하는질 수 있는 replica shard(복사본)의 수, 기본값은 1, 이 설정은 동작하고 있는 index에 대해, 언제라도 변경할 수 있다.

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

예를 들어, 다음 request처럼, 단 하나의 primary shard를 가지고, replica shard가 없는, 조그마한 index를 생성할 수 있다.

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:

나중에, 다음처럼, update-index-settings API를 사용하여, 동적으로 replica shard의 수를 변경할 수 있다.

PUT /my_temp_index/_settings
{
    "number_of_replicas": 1
}


'2.X > 1. Getting Started' 카테고리의 다른 글

1-10-01. Creating an Index  (0) 2017.09.30
1-10-02. Deleting an Index  (0) 2017.09.30
1-10-04. Configuring Analyzers  (0) 2017.09.30
1-10-05. Custom Analyzers  (0) 2017.09.30
1-10-06. Types and Mappings  (0) 2017.09.30