Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize search.remote settings to cluster.remote #33413

Merged
merged 12 commits into from
Sep 6, 2018
24 changes: 12 additions & 12 deletions docs/reference/modules/cross-cluster-search.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ remote clusters that should be connected to, for instance:

[source,yaml]
--------------------------------
search:
cluster:
remote:
cluster_one: <1>
seeds: 127.0.0.1:9300
Expand All @@ -58,7 +58,7 @@ following:
PUT _cluster/settings
{
"persistent": {
"search": {
"cluster": {
"remote": {
"cluster_one": {
"seeds": [
Expand Down Expand Up @@ -94,7 +94,7 @@ because we'll use them later.
{
"acknowledged" : true,
"persistent": {
"search": {
"cluster": {
"remote": {
"cluster_one": {
"seeds": [
Expand Down Expand Up @@ -129,7 +129,7 @@ A remote cluster can be deleted from the cluster settings by setting its seeds t
PUT _cluster/settings
{
"persistent": {
"search": {
"cluster": {
"remote": {
"cluster_three": {
"seeds": null <1>
Expand Down Expand Up @@ -309,7 +309,7 @@ boolean `skip_unavailable` setting, set to `false` by default.
PUT _cluster/settings
{
"persistent": {
"search.remote.cluster_two.skip_unavailable": true <1>
"cluster.remote.cluster_two.skip_unavailable": true <1>
}
}
--------------------------------
Expand Down Expand Up @@ -391,30 +391,30 @@ GET /cluster_one:twitter,cluster_two:twitter,twitter/_search <1>
[[cross-cluster-search-settings]]
=== Cross cluster search settings

`search.remote.connections_per_cluster`::
`cluster.remote.connections_per_cluster`::

The number of nodes to connect to per remote cluster. The default is `3`.

`search.remote.initial_connect_timeout`::
`cluster.remote.initial_connect_timeout`::

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

`search.remote.node.attr`::
`cluster.remote.node.attr`::

A node attribute to filter out nodes that are eligible as a gateway node in
the remote cluster. For instance a node can have a node attribute
`node.attr.gateway: true` such that only nodes with this attribute will be
connected to if `search.remote.node.attr` is set to `gateway`.
connected to if `cluster.remote.node.attr` is set to `gateway`.

`search.remote.connect`::
`cluster.remote.connect`::

By default, any node in the cluster can act as a cross-cluster client and
connect to remote clusters. The `search.remote.connect` setting can be set
connect to remote clusters. The `cluster.remote.connect` setting can be set
to `false` (defaults to `true`) to prevent certain nodes from connecting to
remote clusters. Cross-cluster search requests must be sent to a node that
is allowed to act as a cross-cluster client.

`search.remote.${cluster_alias}.skip_unavailable`::
`cluster.remote.${cluster_alias}.skip_unavailable`::

Per cluster boolean setting that allows to skip specific clusters when no
nodes belonging to them are available and they are searched as part of a
Expand Down
6 changes: 3 additions & 3 deletions docs/reference/modules/ml-node.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ To create a dedicated ingest node when {xpack} is installed, set:
node.master: false <1>
node.data: false <2>
node.ingest: true <3>
search.remote.connect: false <4>
cluster.remote.connect: false <4>
node.ml: false <5>
-------------------
<1> Disable the `node.master` role (enabled by default).
Expand All @@ -75,7 +75,7 @@ To create a dedicated coordinating node when {xpack} is installed, set:
node.master: false <1>
node.data: false <2>
node.ingest: false <3>
search.remote.connect: false <4>
cluster.remote.connect: false <4>
node.ml: false <5>
-------------------
<1> Disable the `node.master` role (enabled by default).
Expand Down Expand Up @@ -105,7 +105,7 @@ To create a dedicated {ml} node, set:
node.master: false <1>
node.data: false <2>
node.ingest: false <3>
search.remote.connect: false <4>
cluster.remote.connect: false <4>
node.ml: true <5>
xpack.ml.enabled: true <6>
-------------------
Expand Down
8 changes: 4 additions & 4 deletions docs/reference/modules/node.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ To create a dedicated master-eligible node, set:
node.master: true <1>
node.data: false <2>
node.ingest: false <3>
search.remote.connect: false <4>
cluster.remote.connect: false <4>
-------------------
<1> The `node.master` role is enabled by default.
<2> Disable the `node.data` role (enabled by default).
Expand Down Expand Up @@ -192,7 +192,7 @@ To create a dedicated data node, set:
node.master: false <1>
node.data: true <2>
node.ingest: false <3>
search.remote.connect: false <4>
cluster.remote.connect: false <4>
-------------------
<1> Disable the `node.master` role (enabled by default).
<2> The `node.data` role is enabled by default.
Expand Down Expand Up @@ -220,7 +220,7 @@ To create a dedicated ingest node, set:
node.master: false <1>
node.data: false <2>
node.ingest: true <3>
search.remote.connect: false <4>
cluster.remote.connect: false <4>
-------------------
<1> Disable the `node.master` role (enabled by default).
<2> Disable the `node.data` role (enabled by default).
Expand Down Expand Up @@ -260,7 +260,7 @@ To create a dedicated coordinating node, set:
node.master: false <1>
node.data: false <2>
node.ingest: false <3>
search.remote.connect: false <4>
cluster.remote.connect: false <4>
-------------------
<1> Disable the `node.master` role (enabled by default).
<2> Disable the `node.data` role (enabled by default).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ public void testSkipUnavailableDependsOnSeeds() throws IOException {
() -> client().performRequest(request));
assertEquals(400, responseException.getResponse().getStatusLine().getStatusCode());
assertThat(responseException.getMessage(),
containsString("Missing required setting [search.remote.remote1.seeds] " +
"for setting [search.remote.remote1.skip_unavailable]"));
containsString("Missing required setting [cluster.remote.remote1.seeds] " +
"for setting [cluster.remote.remote1.skip_unavailable]"));
}

Map<String, Object> settingsMap = new HashMap<>();
Expand All @@ -251,8 +251,8 @@ public void testSkipUnavailableDependsOnSeeds() throws IOException {
ResponseException responseException = expectThrows(ResponseException.class,
() -> client().performRequest(request));
assertEquals(400, responseException.getResponse().getStatusLine().getStatusCode());
assertThat(responseException.getMessage(), containsString("Missing required setting [search.remote.remote1.seeds] " +
"for setting [search.remote.remote1.skip_unavailable]"));
assertThat(responseException.getMessage(), containsString("Missing required setting [cluster.remote.remote1.seeds] " +
"for setting [cluster.remote.remote1.skip_unavailable]"));
}

if (randomBoolean()) {
Expand Down Expand Up @@ -304,7 +304,7 @@ private static HttpEntity buildUpdateSettingsRequestBody(Map<String, Object> set
{
builder.startObject("persistent");
{
builder.startObject("search.remote.remote1");
builder.startObject("cluster.remote.remote1");
{
for (Map.Entry<String, Object> entry : settings.entrySet()) {
builder.field(entry.getKey(), entry.getValue());
Expand Down
8 changes: 4 additions & 4 deletions qa/multi-cluster-search/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ task remoteClusterTest(type: RestIntegTestTask) {
remoteClusterTestCluster {
numNodes = 2
clusterName = 'remote-cluster'
setting 'search.remote.connect', false
setting 'cluster.remote.connect', false
}

remoteClusterTestRunner {
Expand All @@ -39,9 +39,9 @@ task mixedClusterTest(type: RestIntegTestTask) {}

mixedClusterTestCluster {
dependsOn remoteClusterTestRunner
setting 'search.remote.my_remote_cluster.seeds', "\"${-> remoteClusterTest.nodes.get(0).transportUri()}\""
setting 'search.remote.connections_per_cluster', 1
setting 'search.remote.connect', true
setting 'cluster.remote.my_remote_cluster.seeds', "\"${-> remoteClusterTest.nodes.get(0).transportUri()}\""
setting 'cluster.remote.connections_per_cluster', 1
setting 'cluster.remote.connect', true
}

mixedClusterTestRunner {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,16 @@
cluster.get_settings:
include_defaults: true

- set: { defaults.search.remote.my_remote_cluster.seeds.0: remote_ip }
- set: { defaults.cluster.remote.my_remote_cluster.seeds.0: remote_ip }

- do:
cluster.put_settings:
flat_settings: true
body:
transient:
search.remote.test_remote_cluster.seeds: $remote_ip
cluster.remote.test_remote_cluster.seeds: $remote_ip

- match: {transient: {search.remote.test_remote_cluster.seeds: $remote_ip}}
- match: {transient: {cluster.remote.test_remote_cluster.seeds: $remote_ip}}

- do:
search:
Expand All @@ -124,16 +124,16 @@
cluster.get_settings:
include_defaults: true

- set: { defaults.search.remote.my_remote_cluster.seeds.0: remote_ip }
- set: { defaults.cluster.remote.my_remote_cluster.seeds.0: remote_ip }

- do:
cluster.put_settings:
flat_settings: true
body:
transient:
search.remote.test_remote_cluster.seeds: $remote_ip
cluster.remote.test_remote_cluster.seeds: $remote_ip

- match: {transient: {search.remote.test_remote_cluster.seeds: $remote_ip}}
- match: {transient: {cluster.remote.test_remote_cluster.seeds: $remote_ip}}

- do:
search:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
cluster.get_settings:
include_defaults: true

- set: { defaults.search.remote.my_remote_cluster.seeds.0: remote_ip }
- set: { defaults.cluster.remote.my_remote_cluster.seeds.0: remote_ip }

- do:
cluster.put_settings:
flat_settings: true
body:
transient:
search.remote.test_remote_cluster.seeds: $remote_ip
cluster.remote.test_remote_cluster.seeds: $remote_ip

- match: {transient: {search.remote.test_remote_cluster.seeds: $remote_ip}}
- match: {transient: {cluster.remote.test_remote_cluster.seeds: $remote_ip}}

# we do another search here since this will enforce the connection to be established
# otherwise the cluster might not have been connected yet.
Expand Down Expand Up @@ -56,7 +56,7 @@
cluster.put_settings:
body:
transient:
search.remote.test_remote_cluster.seeds: null
cluster.remote.test_remote_cluster.seeds: null

---
"skip_unavailable is returned as part of _remote/info response":
Expand All @@ -68,16 +68,16 @@
cluster.get_settings:
include_defaults: true

- set: { defaults.search.remote.my_remote_cluster.seeds.0: remote_ip }
- set: { defaults.cluster.remote.my_remote_cluster.seeds.0: remote_ip }

- do:
cluster.put_settings:
flat_settings: true
body:
transient:
search.remote.remote1.seeds: $remote_ip
cluster.remote.remote1.seeds: $remote_ip

- match: {transient: {search.remote.remote1.seeds: $remote_ip}}
- match: {transient: {cluster.remote.remote1.seeds: $remote_ip}}

- do:
cluster.remote_info: {}
Expand All @@ -87,9 +87,9 @@
cluster.put_settings:
body:
transient:
search.remote.remote1.skip_unavailable: true
cluster.remote.remote1.skip_unavailable: true

- is_true: transient.search.remote.remote1.skip_unavailable
- is_true: transient.cluster.remote.remote1.skip_unavailable

- do:
cluster.remote_info: {}
Expand All @@ -100,9 +100,9 @@
cluster.put_settings:
body:
transient:
search.remote.remote1.skip_unavailable: false
cluster.remote.remote1.skip_unavailable: false

- is_false: transient.search.remote.remote1.skip_unavailable
- is_false: transient.cluster.remote.remote1.skip_unavailable

- do:
cluster.remote_info: {}
Expand All @@ -113,7 +113,7 @@
cluster.put_settings:
body:
transient:
search.remote.remote1.skip_unavailable: null
cluster.remote.remote1.skip_unavailable: null

- match: {transient: {}}

Expand All @@ -126,5 +126,5 @@
cluster.put_settings:
body:
transient:
search.remote.remote1.seeds: null
search.remote.remote1.skip_unavailable: null
cluster.remote.remote1.seeds: null
cluster.remote.remote1.skip_unavailable: null
Original file line number Diff line number Diff line change
Expand Up @@ -273,12 +273,19 @@ public void apply(Settings value, Settings current, Settings previous) {
ElectMasterService.DISCOVERY_ZEN_MINIMUM_MASTER_NODES_SETTING,
TransportSearchAction.SHARD_COUNT_LIMIT_SETTING,
RemoteClusterAware.REMOTE_CLUSTERS_SEEDS,
RemoteClusterAware.SEARCH_REMOTE_CLUSTERS_SEEDS,
RemoteClusterAware.REMOTE_CLUSTERS_PROXY,
RemoteClusterAware.SEARCH_REMOTE_CLUSTERS_PROXY,
RemoteClusterService.REMOTE_CLUSTER_SKIP_UNAVAILABLE,
RemoteClusterService.SEARCH_REMOTE_CLUSTER_SKIP_UNAVAILABLE,
RemoteClusterService.REMOTE_CONNECTIONS_PER_CLUSTER,
RemoteClusterService.SEARCH_REMOTE_CONNECTIONS_PER_CLUSTER,
RemoteClusterService.REMOTE_INITIAL_CONNECTION_TIMEOUT_SETTING,
RemoteClusterService.SEARCH_REMOTE_INITIAL_CONNECTION_TIMEOUT_SETTING,
RemoteClusterService.REMOTE_NODE_ATTRIBUTE,
RemoteClusterService.SEARCH_REMOTE_NODE_ATTRIBUTE,
RemoteClusterService.ENABLE_REMOTE_CLUSTERS,
RemoteClusterService.SEARCH_ENABLE_REMOTE_CLUSTERS,
TransportService.TRACE_LOG_EXCLUDE_SETTING,
TransportService.TRACE_LOG_INCLUDE_SETTING,
TransportCloseIndexAction.CLUSTER_INDICES_CLOSE_ENABLE_SETTING,
Expand Down
Loading