Skip to content

Commit 3674bbb

Browse files
committed
Add documentation for remote cluster proxy mode
This is related to elastic#49067.
1 parent 4e003fe commit 3674bbb

File tree

2 files changed

+142
-44
lines changed

2 files changed

+142
-44
lines changed

docs/reference/cluster/remote-info.asciidoc

+27-9
Original file line numberDiff line numberDiff line change
@@ -17,29 +17,47 @@ Returns configured remote cluster information.
1717
==== {api-description-title}
1818

1919
The cluster remote info API allows you to retrieve all of the configured
20-
remote cluster information. It returns connection and endpoint information keyed
20+
remote cluster information. It returns connection and endpoint information keyed
2121
by the configured remote cluster alias.
2222

2323

2424
[[cluster-remote-info-api-response-body]]
2525
==== {api-response-body-title}
2626

27-
`seeds`::
28-
The configured initial seed transport addresses of the remote cluster.
27+
`mode`::
28+
The configured connection mode for the remote cluster. Will be `sniff` or
29+
`proxy`.
2930

3031
`connected`::
3132
True if there is at least one connection to the remote cluster.
3233

33-
`num_nodes_connected`::
34-
The number of connected nodes in the remote cluster.
35-
36-
`max_connections_per_cluster`::
37-
The maximum number of connections maintained for the remote cluster.
38-
3934
`initial_connect_timeout`::
4035
The initial connect timeout for remote cluster connections.
4136

4237
[[skip-unavailable]]
4338
`skip_unavailable`::
4439
Whether the remote cluster is skipped in case it is searched through
4540
a {ccs} request but none of its nodes are available.
41+
42+
`seeds`::
43+
The configured initial seed transport addresses of the remote cluster when
44+
sniff mode is configured.
45+
46+
`num_nodes_connected`::
47+
The number of connected nodes in the remote cluster when sniff mode is
48+
configured.
49+
50+
`max_connections_per_cluster`::
51+
The maximum number of connections maintained for the remote cluster when
52+
sniff mode is configured.
53+
54+
`address`::
55+
The configured address for remote connections when proxy mode is configured.
56+
57+
`num_sockets_connected`::
58+
The number of open socket connections to the remote cluster when proxy mode
59+
is configured.
60+
61+
`max_socket_connections`::
62+
The maximum number of socket connections to the remote cluster when proxy
63+
mode is configured.

docs/reference/modules/remote-clusters.asciidoc

+115-35
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,32 @@ endif::[]
1515

1616
// tag::how-remote-clusters-work[]
1717
Remote cluster connections work by configuring a remote cluster and connecting
18-
only to a limited number of nodes in that remote cluster. Each remote cluster
19-
is referenced by a name and a list of seed nodes. When a remote cluster is
20-
registered, its cluster state is retrieved from one of the seed nodes and up
21-
to three _gateway nodes_ are selected to be connected to as part of remote
22-
cluster requests.
23-
// end::how-remote-clusters-work[]
18+
only to a limited number of nodes in that remote cluster. There are two
19+
potential modes for remote cluster connections: sniff mode and proxy mode.
2420

2521
All the communication required between different clusters
2622
goes through the <<modules-transport,transport layer>>. Remote cluster
2723
connections consist of uni-directional connections from the coordinating
28-
node to the selected remote _gateway nodes_ only.
24+
node to the remote remote connections.
25+
// end::how-remote-clusters-work[]
26+
27+
[float]
28+
[[sniff-mode]]
29+
=== Sniff mode
30+
31+
// tag::how-sniff-mode-works[]
32+
A cluster in sniff mode is created by a name and a list of seed nodes. When a
33+
remote cluster is registered, its cluster state is retrieved from one of the
34+
seed nodes and up to three _gateway nodes_ are selected to be connected to as
35+
part of remote cluster requests. This mode requires that the _gateway node_
36+
publish addresses are exposed to the local cluster.
37+
38+
The sniff mode is the default connection mode.
39+
// end::how-remote-clusters-work[]
2940

3041
[float]
3142
[[gateway-nodes-selection]]
32-
=== Gateway nodes selection
43+
==== Gateway nodes selection
3344

3445
The _gateway nodes_ selection depends on the following criteria:
3546

@@ -62,9 +73,26 @@ communicate with 6.7. The matrix below summarizes compatibility as described abo
6273
(see <<remote-cluster-settings>>), though such tagged nodes still have
6374
to satisfy the two above requirements.
6475

76+
[float]
77+
[[proxy-mode]]
78+
=== Proxy mode
79+
80+
// tag::how-proxy-mode-works[]
81+
A cluster in proxy mode is created by a name and a single proxy address. When
82+
a remote cluster is registered, a configurable number of socket connections are
83+
opened to the proxy address. The proxy is required to route those connections to
84+
the remote cluster. Proxy mode does not require that the remote cluster nodes
85+
publish addresses are accessible.
86+
87+
The proxy mode is not the default connection mode and must be configured. Similar
88+
to the sniff <<remote-cluster-compatibility-matrix,gateway nodes>>, the remote
89+
connections are subject to the same version compatibility rules as
90+
<<rolling-upgrades>>.
91+
// end::how-remote-clusters-work[]
92+
6593
[float]
6694
[[configuring-remote-clusters]]
67-
=== Configuring remote clusters
95+
==== Configuring remote clusters
6896

6997
You can configure remote clusters globally by using
7098
<<cluster-update-settings,cluster settings>>, which you can update dynamically.
@@ -83,23 +111,32 @@ cluster:
83111
cluster_one: <1>
84112
seeds: 127.0.0.1:9300 <2>
85113
transport.ping_schedule: 30s <3>
86-
cluster_two:
87-
seeds: 127.0.0.1:9301
88-
transport.compress: true <4>
89-
skip_unavailable: true <5>
114+
cluster_two: <1>
115+
mode: sniff <4>
116+
seeds: 127.0.0.1:9301 <2>
117+
transport.compress: true <5>
118+
skip_unavailable: true <6>
119+
cluster_three: <1>
120+
mode: proxy <4>
121+
proxy_address: 127.0.0.1:9302 <7>
90122
91123
--------------------------------
92-
<1> `cluster_one` and `cluster_two` are arbitrary _cluster aliases_ representing
93-
the connection to each cluster. These names are subsequently used to distinguish
94-
between local and remote indices.
124+
<1> `cluster_one`, `cluster_two`, and `cluster_three` are arbitrary _cluster aliases_
125+
representing the connection to each cluster. These names are subsequently used to
126+
distinguish between local and remote indices.
95127
<2> The hostname and <<modules-transport,transport>> port (default: 9300) of a
96128
seed node in the remote cluster.
97129
<3> A keep-alive ping is configured for `cluster_one`.
98-
<4> Compression is explicitly enabled for requests to `cluster_two`.
99-
<5> Disconnected remote clusters are optional for `cluster_two`.
130+
<4> The configured connection mode. By default it is `sniff`, so the mode is implicit
131+
for `cluster_one`. However, it can be explicitly configured as demonstrated by
132+
`cluster_two` and must be explicitly configured for `proxy` mode as demonstrated by
133+
`cluster_three`.
134+
<5> Compression is explicitly enabled for requests to `cluster_two`.
135+
<6> Disconnected remote clusters are optional for `cluster_two`.
136+
<7> The address for the proxy endpoint used to connect to `cluster_three`.
100137

101138
For more information about the optional transport settings, see
102-
<<modules-transport>>.
139+
<<modules-transport>>.
103140

104141

105142
If you use <<cluster-update-settings,cluster settings>>, the remote clusters
@@ -119,16 +156,16 @@ PUT _cluster/settings
119156
"transport.ping_schedule": "30s"
120157
},
121158
"cluster_two": {
159+
"mode": "sniff",
122160
"seeds": [
123161
"127.0.0.1:9301"
124162
],
125163
"transport.compress": true,
126164
"skip_unavailable": true
127165
},
128166
"cluster_three": {
129-
"seeds": [
130-
"127.0.0.1:9302"
131-
]
167+
"mode": "proxy",
168+
"proxy_address": "127.0.0.1:9302"
132169
}
133170
}
134171
}
@@ -139,7 +176,8 @@ PUT _cluster/settings
139176
// TEST[s/127.0.0.1:9300/\${transport_host}/]
140177

141178
You can dynamically update the compression and ping schedule settings. However,
142-
you must re-include seeds in the settings update request. For example:
179+
you must re-include seeds or proxy_address in the settings update request.
180+
For example:
143181

144182
[source,console]
145183
--------------------------------
@@ -155,10 +193,16 @@ PUT _cluster/settings
155193
"transport.ping_schedule": "60s"
156194
},
157195
"cluster_two": {
196+
"mode": "sniff",
158197
"seeds": [
159198
"127.0.0.1:9301"
160199
],
161200
"transport.compress": false
201+
},
202+
"cluster_three": {
203+
"mode": "proxy",
204+
"proxy_address": "127.0.0.1:9302",
205+
"transport.compress": true
162206
}
163207
}
164208
}
@@ -171,7 +215,7 @@ NOTE: When the compression or ping schedule settings change, all the existing
171215
node connections must close and re-open, which can cause in-flight requests to
172216
fail.
173217

174-
A remote cluster can be deleted from the cluster settings by setting its seeds and optional settings to `null` :
218+
A remote cluster can be deleted from the cluster settings by setting its settings to `null` :
175219

176220
[source,console]
177221
--------------------------------
@@ -181,6 +225,7 @@ PUT _cluster/settings
181225
"cluster": {
182226
"remote": {
183227
"cluster_two": { <1>
228+
"mode": null,
184229
"seeds": null,
185230
"skip_unavailable": null,
186231
"transport": {
@@ -201,23 +246,15 @@ PUT _cluster/settings
201246
[[remote-cluster-settings]]
202247
=== Remote cluster settings
203248

204-
`cluster.remote.connections_per_cluster`::
205-
206-
The number of gateway nodes to connect to per remote cluster. The default is
207-
`3`.
249+
`cluster.remote.${cluster_alias}.mode`::
250+
The mode used for a remote cluster connection. The only supported modes are
251+
`sniff` and `proxy`.
208252

209253
`cluster.remote.initial_connect_timeout`::
210254

211255
The time to wait for remote connections to be established when the node
212256
starts. The default is `30s`.
213257

214-
`cluster.remote.node.attr`::
215-
216-
A node attribute to filter out nodes that are eligible as a gateway node in
217-
the remote cluster. For instance a node can have a node attribute
218-
`node.attr.gateway: true` such that only nodes with this attribute will be
219-
connected to if `cluster.remote.node.attr` is set to `gateway`.
220-
221258
`cluster.remote.connect`::
222259

223260
By default, any node in the cluster can act as a cross-cluster client and
@@ -251,6 +288,49 @@ PUT _cluster/settings
251288
Elasticsearch compresses the response. If unset, the global
252289
`transport.compress` is used as the fallback setting.
253290

291+
[float]
292+
[[remote-cluster-sniff-settings]]
293+
=== Remote cluster sniff mode settings
294+
295+
`cluster.remote.${cluster_alias}.seeds`::
296+
297+
The list of seed nodes used to sniff the remote cluster state.
298+
299+
`cluster.remote.${cluster_alias}.node_connections`::
300+
301+
The number of gateway nodes to connect to for this remote cluster. The default
302+
is `3`.
303+
304+
`cluster.remote.node.attr`::
305+
306+
A node attribute to filter out nodes that are eligible as a gateway node in
307+
the remote cluster. For instance a node can have a node attribute
308+
`node.attr.gateway: true` such that only nodes with this attribute will be
309+
connected to if `cluster.remote.node.attr` is set to `gateway`.
310+
311+
[float]
312+
[[remote-cluster-proxy-settings]]
313+
=== Remote cluster proxy mode settings
314+
315+
`cluster.remote.${cluster_alias}.proxy_address`::
316+
317+
The address used for all remote connections.
318+
319+
`cluster.remote.${cluster_alias}.proxy_socket_connections`::
320+
321+
The number of socket connections to open per remote cluster. The default is
322+
`18`.
323+
ifndef::include-xpack[]
324+
325+
`cluster.remote.${cluster_alias}.server_name`::
326+
327+
An optional hostname string which will be sent in the server_name field of
328+
the TLS Server Name Indication extension if
329+
<<configuring-tls,{TLS is enabled}>>. The TLS transport will fail to open
330+
remote connections if this field is not a valid hostname as defined by the
331+
TLS SNI specification.
332+
endif::[]
333+
254334
[float]
255335
[[retrieve-remote-clusters-info]]
256336
=== Retrieving remote clusters info

0 commit comments

Comments
 (0)