1
1
[[indices-split-index]]
2
2
== Split Index
3
3
4
- number_of_routing_shards
5
-
6
- The split index API allows you to split an existing index into a new index
7
- with multiple of it's primary shards. Similarly to the <<indices-shrink-index,Shrink API>>
8
- where the number of primary shards in the shrunk index must be a factor of the source index.
9
- The `_split` API requires the source index to be created with a specific number of routing shards
10
- in order to be split in the future. (Note: this requirement might be remove in future releases)
11
- The number of routing shards specify the hashing space that is used internally to distribute documents
12
- across shards, in oder to have a consistent hashing that is compatible with the method elasticsearch
13
- uses today.
14
- For example an index with `8` primary shards and a `index.number_of_routing_shards` of `32`
15
- can be split into `16` and `32` primary shards. An index with `1` primary shard
16
- and `index.number_of_routing_shards` of `64` can be split into `2`, `4`, `8`, `16`, `32` or `64`.
17
- The same works for non power of two routing shards ie. an index with `1` primary shard and
18
- `index.number_of_routing_shards` set to `15` can be split into `3` and `15` or alternatively`5` and `15`.
19
- The number of shards in the split index must always be a factor of `index.number_of_routing_shards`
20
- in the source index. Before splitting, a (primary) copy of every shard in the index must be active in the cluster.
4
+ The split index API allows you to split an existing index into a new index,
5
+ where each original primary shard is split into two or more primary shards in
6
+ the new index.
7
+
8
+ IMPORTANT: The `_split` API requires the source index to be created with a
9
+ specific `number_of_routing_shards` in order to be split in the future. This
10
+ requirement has been removed in Elasticsearch 7.0.
11
+
12
+ The number of times the index can be split (and the number of shards that each
13
+ original shard can be split into) is determined by the
14
+ `index.number_of_routing_shards` setting. The number of routing shards
15
+ specifies the hashing space that is used internally to distribute documents
16
+ across shards with consistent hashing. For instance, a 5 shard index with
17
+ `number_of_routing_shards` set to `30` (`5 x 2 x 3`) could be split by a
18
+ factor of `2` or `3`. In other words, it could be split as follows:
19
+
20
+ * `5` -> `10` -> `30` (split by 2, then by 3)
21
+ * `5` -> `15` -> `30` (split by 3, then by 2)
22
+ * `5` -> `30` (split by 6)
21
23
22
24
Splitting works as follows:
23
25
@@ -29,7 +31,7 @@ Splitting works as follows:
29
31
into the new index, which is a much more time consuming process.)
30
32
31
33
* Once the low level files are created all documents will be `hashed` again to delete
32
- documents that belong in a different shard.
34
+ documents that belong to a different shard.
33
35
34
36
* Finally, it recovers the target index as though it were a closed index which
35
37
had just been re-opened.
0 commit comments