From 0923ae47206a09751da1529dce0f9f333dcd094f Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Mon, 7 Dec 2020 14:00:04 -0500 Subject: [PATCH 1/5] [DOCS] Add migrate API to data stream setup --- .../set-up-a-data-stream.asciidoc | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/docs/reference/data-streams/set-up-a-data-stream.asciidoc b/docs/reference/data-streams/set-up-a-data-stream.asciidoc index 09b8f9c0f02f3..d4c359a3ae0f7 100644 --- a/docs/reference/data-streams/set-up-a-data-stream.asciidoc +++ b/docs/reference/data-streams/set-up-a-data-stream.asciidoc @@ -9,6 +9,9 @@ To set up a data stream, follow these steps: . <>. . <>. +You can also <>. + [discrete] [[configure-a-data-stream-ilm-policy]] === Optional: Configure an {ilm-init} lifecycle policy @@ -154,6 +157,69 @@ PUT /_data_stream/my-data-stream // TEST[continued] // TEST[s/my-data-stream/my-data-stream-alt/] +[discrete] +[[convert-an-index-alias-to-a-data-stream]] +=== Convert an index alias to a data stream + +Prior to {es} 7.9, you would typically use an <> +with a write index to manage time series data. Data streams replace most of +this functionality and usually require less maintenance. + +To convert an index alias with a write index to a data stream with the same +name, use the <>. +During conversion, the alias's indices become backing indices for the data +stream. Note the data stream still requires a matching +<>. + +//// +[source,console] +---- +POST idx1/_doc/ +{ + "message" : "testing", + "@timestamp" : "2099-01-01" +} + +POST idx2/_doc/ +{ + "message" : "testing2", + "@timestamp" : "2099-01-01" +} + +POST /_aliases +{ + "actions": [ + { + "add": { + "index": "idx1", + "alias": "my-time-series-data", + "is_write_index": true + } + }, + { + "add": { + "index": "idx2", + "alias": "my-time-series-data" + } + } + ] +} + +PUT /_index_template/template +{ + "index_patterns": ["my-time-series-data"], + "data_stream": { } +} +---- +// TEST[continued] +//// + +[source,console] +---- +POST /_data_stream/_migrate/my-time-series-data +---- +// TEST[continued] + [discrete] [[secure-a-data-stream]] === Secure the data stream From f74fc198f9015b2179b77a31d96ecc6f787d07d7 Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Mon, 7 Dec 2020 15:10:07 -0500 Subject: [PATCH 2/5] add word --- docs/reference/data-streams/set-up-a-data-stream.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/reference/data-streams/set-up-a-data-stream.asciidoc b/docs/reference/data-streams/set-up-a-data-stream.asciidoc index d4c359a3ae0f7..f763d59f864c7 100644 --- a/docs/reference/data-streams/set-up-a-data-stream.asciidoc +++ b/docs/reference/data-streams/set-up-a-data-stream.asciidoc @@ -165,7 +165,7 @@ Prior to {es} 7.9, you would typically use an <> with a write index to manage time series data. Data streams replace most of this functionality and usually require less maintenance. -To convert an index alias with a write index to a data stream with the same +To convert an index alias with a write index to a new data stream with the same name, use the <>. During conversion, the alias's indices become backing indices for the data stream. Note the data stream still requires a matching From 8e220cdcf64f2aa5776c4b9b8fcb9eac69321cfa Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Tue, 8 Dec 2020 10:19:54 -0500 Subject: [PATCH 3/5] Remove section from rollover --- docs/reference/data-streams/data-streams.asciidoc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/reference/data-streams/data-streams.asciidoc b/docs/reference/data-streams/data-streams.asciidoc index c6cb8ee3e485a..ef778159fdbf1 100644 --- a/docs/reference/data-streams/data-streams.asciidoc +++ b/docs/reference/data-streams/data-streams.asciidoc @@ -74,10 +74,8 @@ such as: [[data-streams-rollover]] == Rollover -When you create a data stream, {es} automatically creates a backing index for -the stream. This index also acts as the stream's first write index. A -<> creates a new backing index that becomes the -stream's new write index. +A <> creates a new backing index that becomes +the stream's new write index. We recommend using <> to automatically roll over data streams when the write index reaches a specified age or size. From 27a7c03089ed7e3116741d2e33be65ffc45e2d69 Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Tue, 8 Dec 2020 10:22:13 -0500 Subject: [PATCH 4/5] Add note for write index --- docs/reference/data-streams/set-up-a-data-stream.asciidoc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/reference/data-streams/set-up-a-data-stream.asciidoc b/docs/reference/data-streams/set-up-a-data-stream.asciidoc index f763d59f864c7..758d13369e337 100644 --- a/docs/reference/data-streams/set-up-a-data-stream.asciidoc +++ b/docs/reference/data-streams/set-up-a-data-stream.asciidoc @@ -167,9 +167,10 @@ this functionality and usually require less maintenance. To convert an index alias with a write index to a new data stream with the same name, use the <>. -During conversion, the alias's indices become backing indices for the data -stream. Note the data stream still requires a matching -<>. +During conversion, the alias’s indices become hidden backing indices for the +stream. The alias’s write index becomes the stream’s write index. Note the data +stream still requires a matching <>. //// [source,console] From 800ae627f6a312ad7992635701ebdc7796a3d68d Mon Sep 17 00:00:00 2001 From: James Rodewig <40268737+jrodewig@users.noreply.github.com> Date: Tue, 8 Dec 2020 13:09:34 -0500 Subject: [PATCH 5/5] Relocate ds creation note --- docs/reference/data-streams/set-up-a-data-stream.asciidoc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/reference/data-streams/set-up-a-data-stream.asciidoc b/docs/reference/data-streams/set-up-a-data-stream.asciidoc index 758d13369e337..0325ab87841ed 100644 --- a/docs/reference/data-streams/set-up-a-data-stream.asciidoc +++ b/docs/reference/data-streams/set-up-a-data-stream.asciidoc @@ -157,6 +157,9 @@ PUT /_data_stream/my-data-stream // TEST[continued] // TEST[s/my-data-stream/my-data-stream-alt/] +When you create a data stream, {es} automatically creates a backing index for +the stream. This index also acts as the stream's first write index. + [discrete] [[convert-an-index-alias-to-a-data-stream]] === Convert an index alias to a data stream