Commit graph

84 commits

Author SHA1 Message Date
Adam Locke
5de8613c62
[DOCS] Add links to ESS for setting up remote clusters on cloud. (#68401) 2021-02-02 14:32:54 -05:00
Martijn van Groningen
52afaf2060
Protect replicated data streams against local rollovers (#64710)
When a data stream is being auto followed then a rollover in a local cluster can break auto following,
if the local cluster performs a rollover then it creates a new write index and if then later the remote
cluster rolls over as well then that new write index can't be replicated, because it has the same name
as in the write index in the local cluster, which was created earlier.

If a data stream is managed by ccr, then the local cluster should not do a rollover for those data streams.
The data stream should be rolled over in the remote cluster and that change should replicate to the local
cluster. Performing a rollover in the local cluster is an operation that the data stream support in ccr should
perform.

To protect against rolling over a replicated data stream, this PR adds a replicate field to DataStream class.
The rollover api will fail with an error in case a data stream is being rolled over and the targeted data stream is
a replicated data stream. When the put follow api creates a data stream in the local cluster then the replicate flag
is set to true. There should be a way to turn a replicated data stream into a regular data stream when for example
during disaster recovery. The newly added api in this pr (promote data stream api) is doing that. After a replicated
data stream is promoted to a regular data stream then the local data stream can be rolled over, so that the new
write index is no longer a follower index. Also if the put follow api is attempting to update this data stream
(for example to attempt to resume auto following) then that with fail, because the data stream is no longer a
replicated data stream.

Today with time based indices behind an alias, the is_write_index property isn't replicated from remote cluster
to the local cluster, so when attempting to rollover the alias in the local cluster the rollover fails, because the
alias doesn't have a write index. The added replicated field in the DataStream class and added validation
achieve the same kind of protection, but in a more robust way.

A followup from #61993.
2020-12-08 08:34:24 +01:00
Martijn van Groningen
c4c3c8b422
Add data stream support to CCR (#61993)
This commit adds support data stream support to CCR's auto following by making the following changes:
* When the auto follow coordinator iterates over the candidate indices to follow,
  the auto follow coordinator also checks whether the index is part of a data stream and
  if the name of data stream also matches with the auto follow pattern then the index
  will be auto followed.
* When following an index, the put follow api also checks whether that index is part
  of a data stream and if so then also replicates the data stream definition to the
  local cluster.
* In order for the follow index api to determine whether an index is part of a data
  stream, the cluster state api was modified to also fetch the data stream definition
  of the cluster state if only the state is queried for specific indices.

When a data stream is auto followed, only new backing indices are auto followed.
This is in line with how time based indices patterns are replicated today. This
means that the data stream isn't copied 1 to 1 into the local cluster. The local
cluster's data stream definition contains the same name, timestamp field and
generation, but the list of backing indices may be different (depending on when
a data stream was auto followed).

Closes #56259
2020-11-03 14:01:14 +01:00
Adam Locke
9de8a2f695
Removing erroneous screen capture. (#62561) 2020-09-17 12:22:37 -04:00
Adam Locke
b420caa723
[DOCS] Updating CCR setup to be more tutorial focused (#62256)
* Applying some initial changes.

* Updating intro and screenshots.

* Removing unnecessary links, streamlining content, and adding GIF.

* Adding what's next section.

* Removing what's next.

* Minor edits.

* Apply suggestions from code review

Co-authored-by: debadair <debadair@elastic.co>

* Incorporating review feedback.

* Moving CCR user privileges to another page, plus more edits.

* Apply suggestions from code review

Co-authored-by: debadair <debadair@elastic.co>

* Incorporating more review feedback.

* Adding TESTSETUP to fix build errors.

* Update docs/reference/ccr/getting-started.asciidoc

Co-authored-by: debadair <debadair@elastic.co>

* Swapping GIF for mp4 hosted on web team CMS.

* Removing GIF in favor of mp4.

Co-authored-by: debadair <debadair@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-09-16 16:41:11 -04:00
James Rodewig
bfae8c7633
[DOCS] Fix typo in CCR Put Follow API docs (#61392) (#61471)
Co-authored-by: Mark Laney <mark1@elastic.co>
2020-08-24 09:46:32 -04:00
Adam Locke
610a47c792
[DOCS] Update CCR docs to focus on Kibana (#60555)
* First crack at rewriting the CCR introduction.

* Emphasizing Kibana in configuring CCR (part one).

* Many more edits, plus new files.

* Fixing test case.

* Removing overview page and consolidating that information in the main page.

* Adding redirects for moved and deleted pages.

* Removing, consolidating, and adding redirects.

* Fixing duplicate ID in redirects and removing outdated reference.

* Adding test case and steps for recreating a follower index.

* Adding steps for managing CCR tasks in Kibana.

* Adding tasks for managing auto-follow patterns.

* Fixing glossary link.

* Fixing glossary link, again.

* Updating the upgrade information and other stuff.

* Apply suggestions from code review

* Incorporating review feedback.

* Adding more edits.

* Fixing link reference.

* Adding use cases for #59812.

* Incorporating feedback from reviewers.

* Apply suggestions from code review

* Incorporating more review comments.

* Condensing some of the steps for accessing Kibana.

* Incorporating small changes from reviewers.

Co-authored-by: debadair <debadair@elastic.co>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
2020-08-17 15:36:54 -04:00
Adam Locke
f9d2cb8415
Adding new screenshots and updating copy. (#60407) 2020-07-30 15:30:40 -04:00
Adrien Grand
003a68f7fa
Mention how CCR can help optimize indexing throughput. (#54870) 2020-07-23 18:39:29 +02:00
James Rodewig
2774cd6938
[DOCS] Swap [float] for [discrete] (#60124)
Changes instances of `[float]` in our docs for `[discrete]`.

Asciidoctor prefers the `[discrete]` tag for floating headings:
https://asciidoctor.org/docs/asciidoc-asciidoctor-diffs/#blocks
2020-07-23 11:48:22 -04:00
James Rodewig
80b674fb25
[DOCS] Reformat snippets to use two-space indents (#59973) 2020-07-21 12:24:26 -04:00
Jason Tedor
2e0274266f
Allow follower indices to override leader settings (#58103)
Today when creating a follower index via the put follow API, or via an
auto-follow pattern, it is not possible to specify settings overrides
for the follower index. Instead, we copy all of the leader index
settings to the follower. Yet, there are cases where a user would want
some different settings on the follower index such as the number of
replicas, or allocation settings. This commit addresses this by allowing
the user to specify settings overrides when creating follower index via
manual put follower calls, or via auto-follow patterns. Note that not
all settings can be overrode (e.g., index.number_of_shards) so we also
have detection that prevents attempting to override settings that must
be equal between the leader and follow index. Note that we do not even
allow specifying such settings in the overrides, even if they are
specified to be equal between the leader and the follower
index. Instead, the must be implicitly copied from the leader index, not
explicitly set by the user.
2020-06-18 10:55:17 -04:00
Lisa Cawley
751e2d0deb
[DOCS] Fixes license management links (#58213) 2020-06-16 16:43:54 -07:00
bellengao
411045bc4e
[DOCS] Fix typo in CCR overview docs (#57709) 2020-06-05 17:28:21 -04:00
CJ Cenizal
cde5126620
[Docs] Clarify that _ccr/info omits parameters from the response when the follower index is paused. (#55961) 2020-05-12 15:09:40 -07:00
Lisa Cawley
da531f4cf6
[DOCS] Collapse nested objects in CCR APIs (#54697) 2020-04-03 11:58:25 -07:00
Nhat Nguyen
ac8f5cd542
Remove outdated requirement of CCR (#50859)
With retention leases, users do not need to set 
index.soft_deletes.retention.operations. This change removes it from the
requirements of CCR
2020-01-13 19:59:50 -05:00
Tim Brooks
0cedb9e251
Update remote cluster stats to support simple mode (#49961)
Remote cluster stats API currently only returns useful information if
the strategy in use is the SNIFF mode. This PR modifies the API to
provide relevant information if the user is in the SIMPLE mode. This
information is the configured addresses, max socket connections, and
open socket connections.
2019-12-13 09:16:53 -07:00
James Rodewig
1a574115c1
[DOCS] Document CCR compatibility requirements (#49776)
* Creates a prerequisites section in the cross-cluster replication (CCR)
  overview.
* Adds concise definitions for local and remote cluster in a CCR context.
* Documents that the ES version of the local cluster must be the same
  or a newer compatible version as the remote cluster.
2019-12-02 15:52:13 -05:00
Yannick Welsch
be849b2a4d
Hide orphaned tasks from follower stats (#48901)
CCR follower stats can return information for persistent tasks that are in the process of being cleaned up. This is problematic for tests where CCR follower indices have been deleted, but their persistent follower task is only cleaned up asynchronously afterwards. If one of the following tests then accesses the follower stats, it might still get the stats for that follower task.

In addition, some tests were not cleaning up their auto-follow patterns, leaving orphaned patterns behind. Other tests cleaned up their auto-follow patterns. As always the same name was used, it just depended on the test execution order whether this led to a failure or not. This commit fixes the offensive tests, and will also automatically remove auto-follow-patterns at the end of tests, like we do for many other features.

Closes #48700
2019-11-08 00:01:54 -05:00
bellengao
aee0a78674 [DOCS] Fix shard type in CCR overview doc (#48882)
Closes #48875
2019-11-07 10:08:38 -05:00
Tanguy Leroux
7cd156aab9
Add mention to Pause Auto-Follower API in Upgrade Clusters docs (#48764)
Relates #46665
2019-11-06 09:46:17 -05:00
Yannick Welsch
237e3f0755 Revert "Mute get-ccr-stats doctest (#48375)"
This reverts commit f861927e8b.
2019-10-30 11:12:25 +01:00
Alan Woodward
f861927e8b
Mute get-ccr-stats doctest (#48375)
This test is failing frequently, due to #47718
2019-10-23 15:19:44 +01:00
Tanguy Leroux
58ca9eeb02
Add documentation for Pause/Resume Auto-Follower APIs (#47985)
Relates #47510

Co-Authored-By: James Rodewig <james.rodewig@elastic.co>
2019-10-15 08:24:51 +02:00
Tanguy Leroux
8b82e62ec2
Add Pause/Resume Auto Follower APIs (#47510)
This commit adds two APIs that allow to pause and resume 
CCR auto-follower patterns:

// pause auto-follower
POST /_ccr/auto_follow/my_pattern/pause

// resume auto-follower
POST /_ccr/auto_follow/my_pattern/resume

The ability to pause and resume auto-follow patterns can be 
useful in some situations, including the rolling upgrades of 
cluster using a bi-directional cross-cluster replication scheme 
(see #46665).

This committ adds a new active flag to the AutoFollowPattern 
and adapts the AutoCoordinator and AutoFollower classes so 
that it stops to fetch remote's cluster state when all auto-follow 
patterns associate to the remote cluster are paused.

When an auto-follower is paused, remote indices that match the 
pattern are just ignored: they are not added to the pattern's 
followed indices uids list that is maintained in the local cluster 
state. This way, when the auto-follow pattern is resumed the 
indices created in the remote cluster in the meantime will be 
picked up again and added as new following indices. Indices 
created and then deleted in the remote cluster will be ignored 
as they won't be seen at all by the auto-follower pattern at 
resume time.
2019-10-11 12:33:47 +02:00
Lisa Cawley
4e4990c6a0
[DOCS] Cleans up links to security content (#47610) 2019-10-04 16:10:26 -07:00
Pius
f25e58a257 [DOCS] Add 'remote clusters' requirement link to CCR docs (#47185) 2019-09-26 16:14:42 -04:00
James Rodewig
4281389c73
[DOCS] Remove leveloffset for CCR docs (#46818) 2019-09-18 09:44:28 -04:00
James Rodewig
a8873eff2b
[DOCS] Add CCR docs to the Elasticsearch Reference Guide (#45704)
Previously, cross-cluster replication (CCR) documentation was located in
the Stack Overview:
https://www.elastic.co/guide/en/elastic-stack-overview/master/xpack-ccr.html

This adds CCR documentation to the Elasticsearch Reference Guide with a
level offset for headings.

The level offset and CCR Stack Overview docs will be removed in later
commits.
2019-09-17 14:25:46 -04:00
James Rodewig
5772c1c7dd
[DOCS] [2 of 5] Change // CONSOLE comments to [source,console] (#46353) 2019-09-09 13:13:41 -04:00
James Rodewig
e43be90e6c
[DOCS] [5 of 5] Change // TESTRESPONSE comments to [source,console-results] (#46449) 2019-09-06 14:05:36 -04:00
James Rodewig
466c59a4a7
[DOCS] Replace "// TESTRESPONSE" magic comments with "[source,console-result] (#46295) 2019-09-05 16:47:18 -04:00
Lisa Cawley
b3a7b2221b
[DOCS] Reformats API parameter details (#44194) 2019-07-12 08:26:31 -07:00
lcawl
4e53fd04a0 [DOCS] Fixes broken link 2019-07-04 09:13:00 -07:00
Lisa Cawley
19dbeda54f
[DOCS] Reformat CCR APIs to use new API format (#43952) 2019-07-04 08:22:17 -07:00
Jason Tedor
eafec44513
Add note to CCR docs about mapping/alias updates
This commit adds a note to the docs clarifying that it is not possible
to manually update the mapping nor the aliases of a follower index.
2019-06-09 22:56:24 -04:00
Jason Tedor
bef4af10b0
Add note to CCR docs regarding alias replication
This commit adds a note to the docs regarding the automatic replication
of aliases by a follower index from its leader index.
2019-06-09 22:54:27 -04:00
Jason Tedor
6a98eebeef
Replicate aliases in cross-cluster replication (#41815)
This commit adds functionality so that aliases that are manipulated on
leader indices are replicated by the shard follow tasks to the follower
indices. Note that we ignore write indices. This is due to the fact that
follower indices do not receive direct writes so the concept is not
useful.
2019-06-04 16:44:14 -04:00
James Rodewig
aad6cc4241
[DOCS] Fix X-Pack tag for Asciidoctor (#42443) 2019-05-28 15:18:51 -04:00
Jason Tedor
31503f937b
Remove mention of soft deletes from getting started (#40668)
We no longer need to mention soft deletes in the getting started guide
now that retention leases exist and default to 12h. This commit removes
mention of soft deletes from the getting started guide, to simplify that
content.
2019-03-31 22:10:45 -04:00
Tim Brooks
3d90fbc556
Expand following documentation in ccr overview (#39936)
This commit expands the ccr overview page to include more information
about the lifecycle of following an index. It adds information linking
to the remote recovery documentation. And describes how an index can
fall-behind and how to fix it when this happens.
2019-03-21 12:08:23 -06:00
Jason Tedor
97fa1267dc
Fix CCR forget follower docs example
This example was missing sample values in the forget follower API
call. This commit addresses this.
2019-03-13 10:02:17 -04:00
Martijn van Groningen
2bc661f537
Add minimal docs around upgrading clusters with ccr enabled (#38037) 2019-03-13 10:10:27 +01:00
Lisa Cawley
43065ea536
[DOCS] Replaces CCR terms with attributes (#39516) 2019-03-12 14:27:17 -07:00
Jason Tedor
8c156ed47c
Introduce forget follower API (#39718)
This commit introduces the forget follower API. This API is needed in cases that
unfollowing a following index fails to remove the shard history retention leases
on the leader index. This can happen explicitly through user action, or
implicitly through an index managed by ILM. When this occurs, history will be
retained longer than necessary. While the retention lease will eventually
expire, it can be expensive to allow history to persist for that long, and also
prevent ILM from performing actions like shrink on the leader index. As such, we
introduce an API to allow for manual removal of the shard history retention
leases in this case.
2019-03-07 10:29:10 -05:00
Jason Tedor
669d1937c4
Remove beta label from CCR (#39722)
This commit removes the beta label from CCR.
2019-03-05 22:19:19 -05:00
Tim Brooks
ee41b22e51
Add documentation on remote recovery (#39483)
This is related to #35975. It adds documentation on the remote recovery
process. Additionally, it adds documentation about the various settings
that can impact the process.
2019-03-05 09:50:58 -07:00
Lisa Cawley
7642badfdf
[DOCS] Fix image warnings in CCR documentation (#39430) 2019-02-27 07:34:06 -08:00
Martijn van Groningen
3865435a01
Docs test fix, wait for shards active.
(a restore needs to be complete, which happens in the background and
by default the ccr put follow api doesn't wait for this)

(this was a recent change and the pr that added this docs test,
did not include this change)

Relates to #37917
2019-01-30 11:02:16 +01:00