mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 02:14:54 +00:00
Docs: Consoleify cluster and indices settings docs (#23030)
relates #23001
This commit is contained in:
parent
13446937a5
commit
c91848e6a7
@ -93,7 +93,6 @@ buildRestTests.expectedUnconvertedCandidates = [
|
||||
'reference/cluster/state.asciidoc',
|
||||
'reference/cluster/stats.asciidoc',
|
||||
'reference/cluster/tasks.asciidoc',
|
||||
'reference/cluster/update-settings.asciidoc',
|
||||
'reference/docs/delete-by-query.asciidoc',
|
||||
'reference/docs/delete.asciidoc',
|
||||
'reference/docs/index_.asciidoc',
|
||||
@ -111,7 +110,6 @@ buildRestTests.expectedUnconvertedCandidates = [
|
||||
'reference/indices/segments.asciidoc',
|
||||
'reference/indices/shadow-replicas.asciidoc',
|
||||
'reference/indices/shard-stores.asciidoc',
|
||||
'reference/indices/update-settings.asciidoc',
|
||||
'reference/ingest/ingest-node.asciidoc',
|
||||
'reference/mapping/dynamic/templates.asciidoc',
|
||||
'reference/mapping/fields/all-field.asciidoc',
|
||||
|
@ -7,23 +7,27 @@ survive a full cluster restart). Here is an example:
|
||||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
curl -XPUT localhost:9200/_cluster/settings -d '{
|
||||
PUT /_cluster/settings
|
||||
{
|
||||
"persistent" : {
|
||||
"discovery.zen.minimum_master_nodes" : 2
|
||||
"indices.recovery.max_bytes_per_sec" : "50mb"
|
||||
}
|
||||
}'
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
|
||||
Or:
|
||||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
curl -XPUT localhost:9200/_cluster/settings -d '{
|
||||
PUT /_cluster/settings?flat_settings=true
|
||||
{
|
||||
"transient" : {
|
||||
"discovery.zen.minimum_master_nodes" : 2
|
||||
"indices.recovery.max_bytes_per_sec" : "20mb"
|
||||
}
|
||||
}'
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
|
||||
The cluster responds with the settings updated. So the response for the
|
||||
last example will be:
|
||||
@ -31,12 +35,14 @@ last example will be:
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
{
|
||||
"persistent" : {},
|
||||
...
|
||||
"persistent" : { },
|
||||
"transient" : {
|
||||
"discovery.zen.minimum_master_nodes" : "2"
|
||||
"indices.recovery.max_bytes_per_sec" : "20mb"
|
||||
}
|
||||
}'
|
||||
}
|
||||
--------------------------------------------------
|
||||
// TESTRESPONSE[s/\.\.\./"acknowledged": true,/]
|
||||
|
||||
Resetting persistent or transient settings can be done by assigning a
|
||||
`null` value. If a transient setting is reset, the persistent setting
|
||||
@ -46,12 +52,14 @@ value. Here is an example:
|
||||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
curl -XPUT localhost:9200/_cluster/settings -d '{
|
||||
PUT /_cluster/settings
|
||||
{
|
||||
"transient" : {
|
||||
"discovery.zen.minimum_master_nodes" : null
|
||||
"indices.recovery.max_bytes_per_sec" : null
|
||||
}
|
||||
}'
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
|
||||
Reset settings will not be included in the cluster response. So
|
||||
the response for the last example will be:
|
||||
@ -59,29 +67,34 @@ the response for the last example will be:
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
{
|
||||
...
|
||||
"persistent" : {},
|
||||
"transient" : {}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// TESTRESPONSE[s/\.\.\./"acknowledged": true,/]
|
||||
|
||||
Settings can also be reset using simple wildcards. For instance to reset
|
||||
all dynamic `discovery.zen` setting a prefix can be used:
|
||||
all dynamic `indices.recovery` setting a prefix can be used:
|
||||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
curl -XPUT localhost:9200/_cluster/settings -d '{
|
||||
PUT /_cluster/settings
|
||||
{
|
||||
"transient" : {
|
||||
"discovery.zen.*" : null
|
||||
"indices.recovery.*" : null
|
||||
}
|
||||
}'
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
|
||||
Cluster wide settings can be returned using:
|
||||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
curl -XGET localhost:9200/_cluster/settings
|
||||
GET /_cluster/settings
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
|
||||
[float]
|
||||
=== Precedence of settings
|
||||
|
@ -9,25 +9,15 @@ of the request includes the updated settings, for example:
|
||||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
PUT /twitter/_settings
|
||||
{
|
||||
"index" : {
|
||||
"number_of_replicas" : 4
|
||||
"number_of_replicas" : 2
|
||||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
|
||||
The above will change the number of replicas to 4 from the current
|
||||
number of replicas. Here is a curl example:
|
||||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
curl -XPUT 'localhost:9200/my_index/_settings' -d '
|
||||
{
|
||||
"index" : {
|
||||
"number_of_replicas" : 4
|
||||
}
|
||||
}'
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
// TEST[setup:twitter]
|
||||
|
||||
The list of per-index settings which can be updated dynamically on live
|
||||
indices can be found in <<index-modules>>.
|
||||
@ -43,11 +33,15 @@ use:
|
||||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
curl -XPUT localhost:9200/test/_settings -d '{
|
||||
PUT /twitter/_settings
|
||||
{
|
||||
"index" : {
|
||||
"refresh_interval" : "-1"
|
||||
} }'
|
||||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
// TEST[setup:twitter]
|
||||
|
||||
(Another optimization option is to start the index without any replicas,
|
||||
and only later adding them, but that really depends on the use case).
|
||||
@ -57,18 +51,24 @@ the defaults for example):
|
||||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
curl -XPUT localhost:9200/test/_settings -d '{
|
||||
PUT /twitter/_settings
|
||||
{
|
||||
"index" : {
|
||||
"refresh_interval" : "1s"
|
||||
} }'
|
||||
}
|
||||
}
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
// TEST[continued]
|
||||
|
||||
And, a force merge should be called:
|
||||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
curl -XPOST 'http://localhost:9200/test/_forcemerge?max_num_segments=5'
|
||||
POST /twitter/_forcemerge?max_num_segments=5
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
// TEST[continued]
|
||||
|
||||
[float]
|
||||
[[update-settings-analysis]]
|
||||
@ -83,9 +83,10 @@ you can use the following commands to add it:
|
||||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
curl -XPOST 'localhost:9200/myindex/_close'
|
||||
POST /twitter/_close
|
||||
|
||||
curl -XPUT 'localhost:9200/myindex/_settings' -d '{
|
||||
PUT /twitter/_settings
|
||||
{
|
||||
"analysis" : {
|
||||
"analyzer":{
|
||||
"content":{
|
||||
@ -94,7 +95,9 @@ curl -XPUT 'localhost:9200/myindex/_settings' -d '{
|
||||
}
|
||||
}
|
||||
}
|
||||
}'
|
||||
}
|
||||
|
||||
curl -XPOST 'localhost:9200/myindex/_open'
|
||||
POST /twitter/_open
|
||||
--------------------------------------------------
|
||||
// CONSOLE
|
||||
// TEST[setup:twitter]
|
||||
|
Loading…
x
Reference in New Issue
Block a user