Skip to content

Commit db9dd9f

Browse files
Adam Lockedebadairelasticmachine
authored
[DOCS] Updating CCR setup to be more tutorial focused (#62256) (#62499)
* 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 <[email protected]> * Incorporating review feedback. * Moving CCR user privileges to another page, plus more edits. * Apply suggestions from code review Co-authored-by: debadair <[email protected]> * Incorporating more review feedback. * Adding TESTSETUP to fix build errors. * Update docs/reference/ccr/getting-started.asciidoc Co-authored-by: debadair <[email protected]> * Swapping GIF for mp4 hosted on web team CMS. * Removing GIF in favor of mp4. Co-authored-by: debadair <[email protected]> Co-authored-by: Elastic Machine <[email protected]> Co-authored-by: debadair <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
1 parent 3cf559b commit db9dd9f

File tree

9 files changed

+173
-174
lines changed

9 files changed

+173
-174
lines changed

docs/reference/ccr/getting-started.asciidoc

Lines changed: 121 additions & 174 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,97 @@
11
[role="xpack"]
22
[testenv="platinum"]
33
[[ccr-getting-started]]
4-
=== Set up {ccr}
5-
You can manually create follower indices to replicate specific indices on a
6-
remote cluster, or configure auto-follow patterns to automatically create
7-
follower indices for new time series.
8-
9-
After the follower index is created, the
10-
<<ccr-remote-recovery, remote recovery>> process copies all of the Lucene
11-
segment files from the remote cluster to the local cluster.
12-
13-
To set up {ccr}:
14-
15-
. <<ccr-getting-started-remote-cluster,Connect a local cluster to a remote cluster>>
16-
. <<ccr-getting-started-leader-index,Identify the index (or time series indices) you want to replicate on the remote cluster>>
17-
. <<ccr-enable-soft-deletes,Enable soft deletes on the leader index>>
18-
. Manually create a follower index or create an auto-follow pattern:
19-
* To replicate the leader index, <<ccr-getting-started-follower-index,manually create a follower index>>
20-
* To automatically follow time series indices, <<ccr-getting-started-auto-follow,create an auto-follow pattern>>
4+
=== Tutorial: Set up {ccr}
5+
++++
6+
<titleabbrev>Set up {ccr}</titleabbrev>
7+
++++
218

22-
[[ccr-getting-started-prerequisites]]
23-
==== Prerequisites
24-
If the Elastic {security-features} are enabled in your local and remote
25-
clusters, you need a user with appropriate authority to complete the steps
26-
in this tutorial.
9+
////
10+
[source,console]
11+
----
12+
PUT /server-metrics
13+
{
14+
"settings" : {
15+
"index" : {
16+
"number_of_shards" : 1,
17+
"number_of_replicas" : 0
18+
}
19+
},
20+
"mappings" : {
21+
"properties" : {
22+
"@timestamp" : {
23+
"type" : "date"
24+
},
25+
"accept" : {
26+
"type" : "long"
27+
},
28+
"deny" : {
29+
"type" : "long"
30+
},
31+
"host" : {
32+
"type" : "keyword"
33+
},
34+
"response" : {
35+
"type" : "float"
36+
},
37+
"service" : {
38+
"type" : "keyword"
39+
},
40+
"total" : {
41+
"type" : "long"
42+
}
43+
}
44+
}
45+
}
46+
----
47+
// TESTSETUP
48+
////
2749

28-
By default, you can complete the following steps as the built-in
29-
`elastic` user. However, you must <<get-started-built-in-users,set a password>>
30-
for this user before proceeding.
50+
Use this guide to set up {ccr} (CCR) between clusters in two
51+
datacenters. Replicating your data across datacenters provides several benefits:
3152

32-
WARNING: If you are performing these steps in a production environment, do
33-
not use the `elastic` user.
53+
* Brings data closer to your users or application server to reduce latency and
54+
response time
55+
* Provides your mission-critical applications with the tolerance to withstand datacenter or region outages
3456

35-
Alternatively, you can assign the appropriate privileges to a user ID of your
36-
choice. On the remote cluster that contains the leader index, a user must have
37-
the `read_ccr` cluster privilege and `monitor` and `read` privileges on the
38-
leader index.
57+
In this guide, you'll learn how to:
3958

40-
[source,yml]
41-
--------------------------------------------------
42-
ccr_user:
43-
cluster:
44-
- read_ccr
45-
indices:
46-
- names: [ 'leader-index' ]
47-
privileges:
48-
- monitor
49-
- read
50-
--------------------------------------------------
59+
* Configure a <<modules-remote-clusters,remote cluster>> with a leader index
60+
* Create a follower index on a local cluster
61+
* Create an auto-follow pattern to automatically follow time series indices
62+
that are periodically created in a remote cluster
5163

52-
On the local cluster that contains the follower index, the same user will need
53-
the `manage_ccr` cluster privilege and `monitor`, `read`, `write` and
54-
`manage_follow_index` privileges on the follower index.
64+
You can manually create follower indices to replicate specific indices on a
65+
remote cluster, or configure auto-follow patterns to replicate rolling time series indices.
5566

56-
[source,yml]
57-
--------------------------------------------------
58-
ccr_user:
59-
cluster:
60-
- manage_ccr
61-
indices:
62-
- names: [ 'follower-index' ]
63-
privileges:
64-
- monitor
65-
- read
66-
- write
67-
- manage_follow_index
68-
--------------------------------------------------
67+
video::https://static-www.elastic.co/v3/assets/bltefdd0b53724fa2ce/blt994089f5e841ad69/5f6265de6f40ab4648b5cf9b/ccr-setup-video-edited.mp4[width=700, height=500, options="autoplay,loop"]
6968

70-
If you are managing
71-
<<ccr-getting-started-remote-cluster,connecting to the remote cluster>> using
72-
the cluster update settings API, you will also need a user with the `all`
73-
cluster privilege.
69+
[[ccr-getting-started-prerequisites]]
70+
==== Prerequisites
71+
To complete this tutorial, you need:
72+
73+
* A license on both clusters that includes {ccr}. {kibana-ref}/managing-licenses.html[Activate a free 30-day trial].
74+
* The `read_ccr` cluster privilege and `monitor` and `read` privileges
75+
for the leader index on the remote cluster. <<stack-management-ccr-remote,Configure remote cluster privileges>>.
76+
* The `manage_ccr` cluster privilege and `monitor`, `read`, `write` and
77+
`manage_follow_index` privileges to configure remote clusters and follower
78+
indices on the local cluster. <<stack-management-ccr-local,Configure local cluster privileges>>.
79+
* An index on the remote cluster that contains the data you want to replicate.
80+
This tutorial uses the sample eCommerce orders data set.
81+
{kibana-ref}/get-started.html#gs-get-data-into-kibana[Load sample data].
7482

7583
[[ccr-getting-started-remote-cluster]]
7684
==== Connect to a remote cluster
77-
Connect your local cluster to a
78-
<<modules-remote-clusters,remote cluster>> to begin using cross-cluster
79-
replication.
85+
To replicate an index on a remote cluster (Cluster A) to a local cluster (Cluster B), you configure Cluster A as a remote on Cluster B.
86+
87+
image::images/ccr-tutorial-clusters.png[ClusterA contains the leader index and ClusterB contains the follower index]
8088

81-
To configure a {kibana-ref}/working-remote-clusters.html[remote cluster],
82-
access {kib} and go to
83-
*Management > Stack Management*. In the side navigation, select
84-
*Remote Clusters*.
89+
To configure a remote cluster from Stack Management in {kib}:
8590

86-
Add a remote cluster by specifying the IP address or host name, followed by the
87-
transport port of the remote cluster.
91+
. Select *Remote Clusters* from the side navigation.
92+
. Specify the IP address or host name of the remote cluster (ClusterB),
93+
followed by the transport port of the remote cluster (defaults to `9300`). For
94+
example, `192.168.1.1:9300`.
8895

8996
[role="screenshot"]
9097
image::images/ccr-add-remote-cluster.png["The Add remote clusters page in {kib}"]
@@ -153,96 +160,39 @@ remote cluster.
153160
connected to.
154161
====
155162

156-
[[ccr-getting-started-leader-index]]
157-
==== Create a leader index
158-
To create a leader index, access {kib} on your _remote_ cluster and go to
159-
*Management > Dev Tools*.
160-
161-
Copy the following example into the Console to create a leader index named
162-
`server-metrics` in your remote cluster:
163-
164-
[%collapsible]
165-
.Leader index example
166-
====
167-
[source,console]
168-
--------------------------------------------------
169-
PUT /server-metrics
170-
{
171-
"settings" : {
172-
"index" : {
173-
"number_of_shards" : 1,
174-
"number_of_replicas" : 0
175-
}
176-
},
177-
"mappings" : {
178-
"properties" : {
179-
"@timestamp" : {
180-
"type" : "date"
181-
},
182-
"accept" : {
183-
"type" : "long"
184-
},
185-
"deny" : {
186-
"type" : "long"
187-
},
188-
"host" : {
189-
"type" : "keyword"
190-
},
191-
"response" : {
192-
"type" : "float"
193-
},
194-
"service" : {
195-
"type" : "keyword"
196-
},
197-
"total" : {
198-
"type" : "long"
199-
}
200-
}
201-
}
202-
}
203-
--------------------------------------------------
204-
// TEST[continued]
205-
====
206-
207163
[[ccr-enable-soft-deletes]]
208164
==== Enable soft deletes on leader indices
209-
<<ccr-leader-requirements,Soft deletes>> must be enabled for indices that you want to
210-
use as leader indices. Soft deletes are enabled by default on new indices
211-
created on or after {es} 7.0.0, so
212-
*no further action is required if your cluster is running {es} 7.0.0 or later*.
213-
214-
include::{es-ref-dir}/ccr/index.asciidoc[tag=ccr-existing-indices-tag]
215-
216-
To enable soft deletes on indices created on versions of
217-
{es} between 6.5.0 and 7.0.0, set <<ccr-index-soft-deletes,`index.soft_deletes.enabled`>> to `true`.
165+
To follow an index, it must have been created with
166+
<<ccr-leader-requirements,soft deletes>> enabled. If the index doesn’t have
167+
soft deletes enabled, you must reindex it and use the new index as the leader
168+
index. Soft deletes are enabled by default on new indices
169+
created with {es} 7.0.0 and later.
218170

219171
[[ccr-getting-started-follower-index]]
220-
==== Create a follower index
221-
When you create a {kibana-ref}/managing-cross-cluster-replication.html#_create_specific_follower_indices[follower index], you
222-
must reference the
223-
<<ccr-getting-started-remote-cluster,remote cluster>> and the
224-
<<ccr-getting-started-leader-index,leader index>> that you created in the remote
225-
cluster.
172+
==== Create a follower index to replicate a specific index
173+
When you create a follower index, you reference the remote cluster and the
174+
leader index in your remote cluster.
226175

227-
To create a follower index, access {kib} and go to
228-
*Management > Stack Management*. In the side navigation, select
229-
*Cross-Cluster Replication* and choose the *Follower Indices* tab.
176+
To create a follower index from Stack Management in {kib}:
230177

231-
. Choose the remote cluster containing the index you want to replicate, which
232-
is `leader` if you are following the tutorial.
233-
. Enter the name of the leader index, which is `server-metrics` if you are
234-
following the tutorial.
178+
. Select *Cross-Cluster Replication* in the side navigation and choose the
179+
*Follower Indices* tab.
180+
. Choose the cluster (ClusterA) containing the leader index you want to
181+
replicate.
182+
. Enter the name of the leader index, which is
183+
`kibana_sample_data_ecommerce` if you are following the tutorial.
184+
. Enter a name for your follower index, such as `follower-kibana-sample-data`.
235185

236186
image::images/ccr-add-follower-index.png["Adding a follower index named server-metrics in {kib}"]
237187

238-
The follower index is initialized using the
188+
{es} initializes the follower using the
239189
<<ccr-remote-recovery, remote recovery>>
240190
process, which transfers the existing Lucene segment files from the leader
241191
index to the follower index. The index status changes to *Paused*. When the
242192
remote recovery process is complete, the index following begins and the status
243193
changes to *Active*.
244194

245-
When you index documents into your leader index, the documents are replicated
195+
When you index documents into your leader index, {es} replicates the documents
246196
in the follower index.
247197

248198
[role="screenshot"]
@@ -252,9 +202,8 @@ image::images/ccr-follower-index.png["The Cross-Cluster Replication page in {kib
252202
.API example
253203
====
254204
Use the <<ccr-put-follow,create follower API>> to create follower indices.
255-
When you create a follower index, you must reference the
256-
<<ccr-getting-started-remote-cluster,remote cluster>> and the
257-
<<ccr-getting-started-leader-index,leader index>> that you created in the
205+
When you create a follower index, you must reference the remote cluster and the
206+
leader index that you created in the
258207
remote cluster.
259208
260209
When initiating the follower request, the response returns before the
@@ -304,37 +253,35 @@ POST /server-metrics-follower/_ccr/unfollow
304253
====
305254

306255
[[ccr-getting-started-auto-follow]]
307-
==== Automatically create follower indices
308-
Create <<ccr-auto-follow,auto-follow patterns>> to automatically follow time
309-
series indices that are periodically created in a remote cluster (such as daily
310-
{beats} indices).
256+
==== Create an auto-follow pattern to replicate time series indices
257+
You use <<ccr-auto-follow,auto-follow patterns>> to automatically create new
258+
followers for rolling time series indices. Whenever the name of a new index on
259+
the remote cluster matches the auto-follow pattern, a corresponding follower
260+
index is added to the local cluster.
311261

312-
With an auto-follow pattern, you reference the
313-
<<ccr-getting-started-remote-cluster,remote cluster>> connected to your
314-
local cluster. You must also specify a collection of patterns that match the
315-
indices you want to automatically follow.
262+
An auto-follow pattern specifies the remote cluster you want to replicate from,
263+
and one or more index patterns that specify the rolling time series indices you
264+
want to replicate.
316265

317266
// tag::ccr-create-auto-follow-pattern-tag[]
318-
To create follower indices from an {kibana-ref}/managing-cross-cluster-replication.html#_create_follower_indices_from_an_auto_follow_pattern[auto-follow pattern],
319-
access {kib} on your remote cluster and go to
320-
*Management > Stack Management*. In the side navigation, select
321-
*Cross Cluster Replication* and choose the *Auto-follow patterns* tab.
322-
323-
[role="screenshot"]
324-
image::images/auto-follow-patterns.png["The Auto-follow patterns page in {kib}"]
325-
326-
* Enter a name for the auto-follow pattern. For this tutorial, enter `beats`
327-
as the name.
328-
* Choose the remote cluster containing the index you want to replicate, which
329-
is `leader` if you are following the tutorial.
330-
* Enter one or more index patterns that identify the indices you want to
331-
replicate from the remote cluster. For this tutorial, enter
332-
`metricbeat-*,packetbeat-*` as the index pattern.
333-
* Enter *copy-* as the prefix to apply to the names of the follower indices so
267+
To create an auto-follow pattern from Stack Management in {kib}:
268+
269+
. Select *Cross Cluster Replication* in the side navigation and choose the
270+
*Auto-follow patterns* tab.
271+
. Enter a name for the auto-follow pattern, such as `beats`.
272+
. Choose the remote cluster that contains the index you want to replicate,
273+
which in the example scenario is Cluster A.
274+
. Enter one or more index patterns that identify the indices you want to
275+
replicate from the remote cluster. For example, enter
276+
`metricbeat-* packetbeat-*` to automatically create followers for {metricbeat} and {packetbeat} indices.
277+
. Enter *follower-* as the prefix to apply to the names of the follower indices so
334278
you can more easily identify replicated indices.
335279

336280
As new indices matching these patterns are
337-
created, they are replicated to the follower indices.
281+
created on the remote, {es} automatically replicates them to local follower indices.
282+
283+
[role="screenshot"]
284+
image::images/auto-follow-patterns.png["The Auto-follow patterns page in {kib}"]
338285

339286
// end::ccr-create-auto-follow-pattern-tag[]
340287

357 KB
Loading
-3.2 KB
Loading
7.65 KB
Loading
526 Bytes
Loading
15 KB
Loading
58.8 KB
Loading

x-pack/docs/en/security/authorization/index.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ include::built-in-roles.asciidoc[]
55

66
include::managing-roles.asciidoc[]
77

8+
include::stack-management.asciidoc[]
9+
810
include::privileges.asciidoc[]
911

1012
include::document-level-security.asciidoc[]

0 commit comments

Comments
 (0)