Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions deploy-manage/autoscaling/autoscaling-deciders.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ PUT /_autoscaling/policy/my_autoscaling_policy
}
}
```
% TEST

The API returns the following result:

Expand Down Expand Up @@ -157,6 +158,7 @@ PUT /_autoscaling/policy/my_autoscaling_policy
}
}
```
% TEST

The API returns the following result:

Expand Down Expand Up @@ -213,6 +215,7 @@ PUT /_autoscaling/policy/my_autoscaling_policy
}
}
```
% TEST

The API returns the following result:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ cd elasticsearch-9.0.0-beta1/ <2>

1. Compares the SHA of the downloaded `.tar.gz` archive and the published checksum, which should output `elasticsearch-{{version}}-darwin-x86_64.tar.gz: OK`.
2. This directory is known as `$ES_HOME`.

% NOTCONSOLE


## Enable automatic creation of system indices [targz-enable-indices]
Expand Down Expand Up @@ -167,7 +167,7 @@ curl --cacert $ES_HOME/config/certs/http_ca.crt -u elastic:$ELASTIC_PASSWORD htt

1. Ensure that you use `https` in your call, or the request will fail.`--cacert`
: Path to the generated `http_ca.crt` certificate for the HTTP layer.

% NOTCONSOLE


The call returns a response like this:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ curl --cacert /etc/elasticsearch/certs/http_ca.crt -u elastic:$ELASTIC_PASSWORD

1. Ensure that you use `https` in your call, or the request will fail.`--cacert`
: Path to the generated `http_ca.crt` certificate for the HTTP layer.

% NOTCONSOLE


The call returns a response like this:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ curl --cacert /etc/elasticsearch/certs/http_ca.crt -u elastic:$ELASTIC_PASSWORD

1. Ensure that you use `https` in your call, or the request will fail.`--cacert`
: Path to the generated `http_ca.crt` certificate for the HTTP layer.

% NOTCONSOLE


The call returns a response like this:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ curl --cacert %ES_HOME%\config\certs\http_ca.crt -u elastic:$ELASTIC_PASSWORD ht

1. Ensure that you use `https` in your call, or the request will fail.`--cacert`
: Path to the generated `http_ca.crt` certificate for the HTTP layer.

% NOTCONSOLE


The call returns a response like this:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ To set up {{es}} and {{kib}} locally, run the `start-local` script:
```sh
curl -fsSL https://elastic.co/start-local | sh
```
% NOTCONSOLE

This script creates an `elastic-start-local` folder containing configuration files and starts both {{es}} and {{kib}} using Docker.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ PUT _all/_settings
}
}
```
% TEST[s/^/PUT test\n/]

With delayed allocation enabled, the above scenario changes to look like this:

Expand Down Expand Up @@ -83,6 +84,7 @@ PUT _all/_settings
}
}
```
% TEST[s/^/PUT test\n/]

You can reset the timeout as soon as the missing shards have started to recover.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ POST /_cluster/voting_config_exclusions?node_names=node_name
# auto-reconfiguration up to one minute
POST /_cluster/voting_config_exclusions?node_names=node_name&timeout=1m
```
% TEST[skip:this would break the test cluster if executed]

The nodes that should be added to the exclusions list are specified by name using the `?node_names` query parameter, or by their persistent node IDs using the `?node_ids` query parameter. If a call to the voting configuration exclusions API fails, you can safely retry it. Only a successful response guarantees that the node has actually been removed from the voting configuration and will not be reinstated. If the elected master node is excluded from the voting configuration then it will abdicate to another master-eligible node that is still in the voting configuration if such a node is available.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ Nodes exceeding the low watermark threshold will be slow to restart. Reduce the

GET _cat/nodes
```
% TEST[continued]

The `status` column returned by `_cat/health` shows the health of each node in the cluster: `red`, `yellow`, or `green`.

Expand Down Expand Up @@ -118,6 +119,7 @@ Nodes exceeding the low watermark threshold will be slow to restart. Reduce the
```console
POST _ml/set_upgrade_mode?enabled=false
```
% TEST[continued]

If you closed all {{ml}} jobs before stopping the nodes, open the jobs and start the datafeeds from {{kib}} or with the [open jobs](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-open-job) and [start datafeed](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-start-datafeed) APIs.

Expand Down Expand Up @@ -208,5 +210,6 @@ Nodes exceeding the low watermark threshold will be slow to restart. Reduce the
```console
POST _ml/set_upgrade_mode?enabled=false
```
% TEST[continued]

If you closed all {{ml}} jobs before stopping the nodes, open the jobs and start the datafeeds from {{kib}} or with the [open jobs](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-open-job) and [start datafeed](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ml-start-datafeed) APIs.
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ You can identify what is triggering deprecated functionality if `X-Opaque-Id` wa
"node.id": "D7fUYfnfTLa2D7y-xw6tZg"
}
```
% NOTCONSOLE

Deprecation logs can be indexed into `.logs-deprecation.elasticsearch-default` data stream `cluster.deprecation_indexing.enabled` setting is set to true.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ You can identify what is triggering deprecated functionality if `X-Opaque-Id` wa
"node.id": "D7fUYfnfTLa2D7y-xw6tZg"
}
```
% NOTCONSOLE

Deprecation logs can be indexed into `.logs-deprecation.elasticsearch-default` data stream `cluster.deprecation_indexing.enabled` setting is set to true.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ You can identify what is triggering deprecated functionality if `X-Opaque-Id` wa
"node.id": "D7fUYfnfTLa2D7y-xw6tZg"
}
```
% NOTCONSOLE

Deprecation logs can be indexed into `.logs-deprecation.elasticsearch-default` data stream `cluster.deprecation_indexing.enabled` setting is set to true.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ To learn about monitoring in general, see [Monitor a cluster](../../monitor.md).
```console
GET _cluster/settings
```
% TEST[warning:[xpack.monitoring.collection.enabled] setting was deprecated in Elasticsearch and will be removed in a future release.]

```console
PUT _cluster/settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ To see the current size of your shards, use the [cat shards API](https://www.ela
```console
GET _cat/shards?v=true&h=index,prirep,shard,store&s=prirep,store&bytes=gb
```
% TEST[setup:my_index]

The `pri.store.size` value shows the combined size of all primary shards for the index.

Expand All @@ -97,6 +98,9 @@ index prirep shard store
.ds-my-data-stream-2099.05.06-000001 p 0 50gb
...
```
% TESTRESPONSE[non_json]
% TESTRESPONSE[s/.ds-my-data-stream-2099.05.06-000001/my-index-000001/]
% TESTRESPONSE[s/50gb/.*/]

If an index’s shard is experiencing degraded performance from surpassing the recommended 50GB size, you may consider fixing the index’s shards' sizing. Shards are immutable and therefore their size is fixed in place, so indices must be copied with corrected settings. This requires first ensuring sufficient disk to copy the data. Afterwards, you can copy the index’s data with corrected settings via one of the following options:

Expand All @@ -123,12 +127,14 @@ To check the configured size of each node’s heap, use the [cat nodes API](http
```console
GET _cat/nodes?v=true&h=heap.max
```
% TEST[setup:my_index]

You can use the [cat shards API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cat-shards) to check the number of shards per node.

```console
GET _cat/shards?v=true
```
% TEST[setup:my_index]


### Add enough nodes to stay within the cluster shard limits [shard-count-per-node-recommendation]
Expand All @@ -148,6 +154,7 @@ Each node in the cluster has a copy of the [cluster state](https://www.elastic.c
```console
GET _cluster/stats?human&filter_path=indices.mappings.total_deduplicated_mapping_size*
```
% TEST[setup:node]

This will show you information like in this example output:

Expand All @@ -161,6 +168,8 @@ This will show you information like in this example output:
}
}
```
% TESTRESPONSE[s/"total_deduplicated_mapping_size": "1gb"/"total_deduplicated_mapping_size": $body.$_path/]
% TESTRESPONSE[s/"total_deduplicated_mapping_size_in_bytes": 1073741824/"total_deduplicated_mapping_size_in_bytes": $body.$_path/]


#### Retrieving heap size and field mapper overheads [_retrieving_heap_size_and_field_mapper_overheads]
Expand All @@ -173,6 +182,7 @@ You can use the [Nodes stats API](https://www.elastic.co/docs/api/doc/elasticsea
```console
GET _nodes/stats?human&filter_path=nodes.*.name,nodes.*.indices.mappings.total_estimated_overhead*,nodes.*.jvm.mem.heap_max*
```
% TEST[setup:node]

For each node, this will show you information like in this example output:

Expand All @@ -197,6 +207,12 @@ For each node, this will show you information like in this example output:
}
}
```
% TESTRESPONSE[s/"USpTGYaBSIKbgSUJR2Z9lg"/$node_name/]
% TESTRESPONSE[s/"name": "node-0"/"name": $body.$_path/]
% TESTRESPONSE[s/"total_estimated_overhead": "1gb"/"total_estimated_overhead": $body.$_path/]
% TESTRESPONSE[s/"total_estimated_overhead_in_bytes": 1073741824/"total_estimated_overhead_in_bytes": $body.$_path/]
% TESTRESPONSE[s/"heap_max": "4gb"/"heap_max": $body.$_path/]
% TESTRESPONSE[s/"heap_max_in_bytes": 4294967296/"heap_max_in_bytes": $body.$_path/]


#### Consider additional heap overheads [_consider_additional_heap_overheads]
Expand Down Expand Up @@ -233,6 +249,7 @@ PUT my-index-000001/_settings
}
}
```
% TEST[setup:my_index]


### Avoid unnecessary mapped fields [avoid-unnecessary-fields]
Expand Down Expand Up @@ -263,12 +280,14 @@ You can find these empty indices using the [cat count API](https://www.elastic.c
```console
GET _cat/count/my-index-000001?v=true
```
% TEST[setup:my_index]

Once you have a list of empty indices, you can delete them using the [delete index API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete). You can also delete any other unneeded indices.

```console
DELETE my-index-000001
```
% TEST[setup:my_index]


### Force merge during off-peak hours [force-merge-during-off-peak-hours]
Expand All @@ -278,6 +297,7 @@ If you no longer write to an index, you can use the [force merge API](https://ww
```console
POST my-index-000001/_forcemerge
```
% TEST[setup:my_index]


### Shrink an existing index to fewer shards [shrink-existing-index-to-fewer-shards]
Expand Down Expand Up @@ -364,6 +384,7 @@ If you encounter this problem, try to mitigate it by using the [Force Merge API]
```console
POST my-index-000001/_forcemerge?only_expunge_deletes=true
```
% TEST[setup:my_index]

This will launch an asynchronous task which can be monitored via the [Task Management API](https://www.elastic.co/docs/api/doc/elasticsearch/group/endpoint-tasks).

Expand Down
19 changes: 17 additions & 2 deletions deploy-manage/remote-clusters/remote-clusters-api-key.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,15 @@ PUT /_cluster/settings

1. The cluster alias of this remote cluster is `cluster_one`.
2. Specifies the hostname and remote cluster port of a seed node in the remote cluster.

% TEST[setup:host]
% TEST[s/127.0.0.1:{{remote-interface-default-port}}/${transport_host}/]

You can use the [remote cluster info API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-remote-info) to verify that the local cluster is successfully connected to the remote cluster:

```console
GET /_remote/info
```
% TEST[continued]

The API response indicates that the local cluster is connected to the remote cluster with the cluster alias `cluster_one`:

Expand All @@ -200,7 +202,10 @@ The API response indicates that the local cluster is connected to the remote clu
1. The number of nodes in the remote cluster the local cluster is connected to.
2. Indicates whether to skip the remote cluster if searched through {{ccs}} but no nodes are available.
3. If present, indicates the remote cluster has connected using API key authentication.

% TESTRESPONSE[s/127.0.0.1:{{remote-interface-default-port}}/$body.cluster_one.seeds.0/]
% TESTRESPONSE[s/ifeval::(.|\n)*endif::[]//]
% TEST[s/"connected" : true/"connected" : $body.cluster_one.connected/]
% TEST[s/"num_nodes_connected" : 1/"num_nodes_connected" : $body.cluster_one.num_nodes_connected/]

### Dynamically configure remote clusters [_dynamically_configure_remote_clusters]

Expand Down Expand Up @@ -238,6 +243,10 @@ PUT _cluster/settings
}
}
```
% TEST[setup:host]
% TEST[s/127.0.0.1:{{remote-interface-default-port}}/${transport_host}/]
% TEST[s/{{remote-interface-default-port-plus1}}/9301/]
% TEST[s/{{remote-interface-default-port-plus2}}/9302/]

You can dynamically update settings for a remote cluster after the initial configuration. The following request updates the compression settings for `cluster_two`, and the compression and ping schedule settings for `cluster_three`.

Expand All @@ -264,6 +273,7 @@ PUT _cluster/settings
}
}
```
% TEST[continued]

You can delete a remote cluster from the cluster settings by passing `null` values for each remote cluster setting. The following request removes `cluster_two` from the cluster settings, leaving `cluster_one` and `cluster_three` intact:

Expand All @@ -284,6 +294,7 @@ PUT _cluster/settings
}
}
```
% TEST[continued]


### Statically configure remote clusters [_statically_configure_remote_clusters]
Expand Down Expand Up @@ -355,6 +366,7 @@ POST /_security/role/remote-replication
]
}
```
% TEST[skip:TODO]

After creating the local `remote-replication` role, use the [Create or update users](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-put-user) API to create a user on the local cluster cluster and assign the `remote-replication` role. For example, the following request assigns the `remote-replication` role to a user named `cross-cluster-user`:

Expand All @@ -365,6 +377,7 @@ POST /_security/user/cross-cluster-user
"roles" : [ "remote-replication" ]
}
```
% TEST[skip:TODO]

Note that you only need to create this user on the local cluster.

Expand All @@ -391,6 +404,7 @@ POST /_security/role/remote-search
]
}
```
% TEST[skip:TODO]

After creating the `remote-search` role, use the [Create or update users](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-security-put-user) API to create a user on the local cluster and assign the `remote-search` role. For example, the following request assigns the `remote-search` role to a user named `cross-search-user`:

Expand All @@ -401,5 +415,6 @@ POST /_security/user/cross-search-user
"roles" : [ "remote-search" ]
}
```
% TEST[skip:TODO]

Note that you only need to create this user on the local cluster.
Loading