OpenSearch/docs/reference/indices
Simon Willnauer 502a775a7c Add primitive to shrink an index into a single shard (#18270)
This adds a low level primitive operations to shrink an existing
index into a new index with a single shard. This primitive expects
all shards of the source index to allocated on a single node. Once the target index is initializing on the shrink node it takes a snapshot of the source index shards and copies all files into the target indices data folder. An [optimization](https://issues.apache.org/jira/browse/LUCENE-7300) coming in Lucene 6.1 will also allow for optional constant time copy if hard-links are supported by the filesystem. All mappings are merged into the new indexes metadata once the snapshots have been taken on the merge node.

To shrink an existing index all shards must be moved to a single node (one instance of each shard) and the index must be read-only:

```BASH
$ curl -XPUT 'http://localhost:9200/logs/_settings' -d '{
    "settings" : {
        "index.routing.allocation.require._name" : "shrink_node_name",
        "index.blocks.write" : true 
    }
}
```
once all shards are started on the shrink node. the new index can be created via:

```BASH
$ curl -XPUT 'http://localhost:9200/logs/_shrink/logs_single_shard' -d '{
    "settings" : {
        "index.codec" : "best_compression",
        "index.number_of_replicas" : 1
    }
}'
```

This API will perform all needed check before the new index is created and selects the shrink node based on the allocation of the source index. This call returns immediately, to monitor shrink progress the recovery API should be used since all copy operations are reflected in the recovery API with byte copy progress etc.

The shrink operation does not modify the source index, if a shrink operation should
be canceled or if the shrink failed, the target index can simply be deleted and
all resources are released.
2016-05-31 10:41:44 +02:00
..
aliases.asciidoc Add TESTRESPONSE code 2016-05-12 18:44:08 -07:00
analyze.asciidoc Renamed all AUTOSENSE snippets to CONSOLE (#18210) 2016-05-09 15:42:23 +02:00
clearcache.asciidoc Merge pull request #17030 from 36degrees/patch-1 2016-03-09 15:34:15 +01:00
create-index.asciidoc Add missing comma in JSON data in curl example 2016-05-09 21:20:37 -04:00
delete-index.asciidoc Merge pull request #15856 from marcbachmann/patch-1 2016-01-10 10:48:32 +01:00
flush.asciidoc Renamed all AUTOSENSE snippets to CONSOLE (#18210) 2016-05-09 15:42:23 +02:00
forcemerge.asciidoc Add Force Merge API, deprecate Optimize API 2015-10-20 09:00:24 -06:00
get-field-mapping.asciidoc Document 5.0 mapping changes. 2016-03-22 16:22:58 +01:00
get-index.asciidoc Remove warmers and the warmer API. 2016-01-07 09:57:07 +01:00
get-mapping.asciidoc Docs: Removed all the added/deprecated tags from 1.x 2014-09-26 21:04:42 +02:00
get-settings.asciidoc Update get-settings.asciidoc 2015-10-02 16:46:45 +02:00
indices-exists.asciidoc [DOCS] add -i flag to more curl HEAD calls 2015-03-21 08:56:20 +01:00
open-close.asciidoc Add option to disable closing indices 2015-10-16 22:10:51 +02:00
put-mapping.asciidoc Renamed all AUTOSENSE snippets to CONSOLE (#18210) 2016-05-09 15:42:23 +02:00
recovery.asciidoc Consolidate shard level abstractions 2015-06-24 15:18:04 +02:00
refresh.asciidoc Rename RobinEngine and friends to InternalEngine 2014-01-13 15:49:10 +01:00
segments.asciidoc Update segments.asciidoc 2016-01-28 13:33:01 +01:00
shadow-replicas.asciidoc [DOCS] Add blurb about `data_path` not needing to include index name 2016-02-21 13:11:45 -07:00
shard-stores.asciidoc Fix typos in docs. 2016-02-09 02:07:32 -08:00
shrink-index.asciidoc Add primitive to shrink an index into a single shard (#18270) 2016-05-31 10:41:44 +02:00
stats.asciidoc document suggest stats being merged with search stats 2016-03-23 16:37:57 -04:00
templates.asciidoc Renamed all AUTOSENSE snippets to CONSOLE (#18210) 2016-05-09 15:42:23 +02:00
types-exists.asciidoc [DOCS] add -i flag to curl HEAD call 2015-03-21 08:56:12 +01:00
update-settings.asciidoc Add Force Merge API, deprecate Optimize API 2015-10-20 09:00:24 -06:00
upgrade.asciidoc Docs: Updated the upgrade API docs to explain that the reindex API should be used instead 2016-03-31 14:34:31 +02:00