7.16 adds a new stream/index for deprecation logging.
e.g. the first one today is .ds-.logs-deprecation.elasticsearch-default-2021.12.09-000001
However, it is created with "number_of_replicas": "1"
and I only have one node, so it's always yellow. (I don't care about possible data loss.)
How to configure the replica settings for these indexes?
Via a config setting or an index template?
1 Like
ivp
December 11, 2021, 10:56am
2
Try:
curl -X PUT "127.0.0.1:9200/.logs-deprecation.elasticsearch-default/_settings" -H 'Content-Type: application/json' -d'{ "index" : { "number_of_replicas" : 0 } }'
1 Like
But does that also apply to all the future indexes as the date rolls?
ivp
December 25, 2021, 10:49am
4
It doesn't work with future indexes.
Let's try this one:
curl -X PUT "127.0.0.1:9200/.*/_settings" -H 'Content-Type: application/json' -d'{ "index" : { "number_of_replicas" : 0 } }'
Hopefully someone will find better solution.
That still doesn't work with future indexes
Is there no index template or config to control the deprecation log index?
VamPikmin
(Vam Pikmin)
January 22, 2022, 3:00am
6
I have the same problem and have posted here
Hello boys and girls
I have a single ES node which has one index turn yellow
curl -XGET localhost:9200/_cat/health
1639519203 22:00:03 ndelastic yellow 1 1 317 317 0 0 1 0 - 99.7%
curl -XGET localhost:9200/_cluster/allocation/explain?pretty
{
"note" : "No shard was specified in the explain API request, so this response explains a randomly chosen unassigned shard. There may be other unassigned shards in this cluster which cannot be assigned for different reasons. It may not be possible to a…
Creating a template (legacy) doesn't appear to work even though it matches. Need to read up on datastream
[2022-01-22T15:30:10,295][WARN ][o.e.c.m.MetadataIndexTemplateService] [elastic] legacy template [.logs-deprecation.elasticsearch-default] has index patterns [.logs-deprecation.elasticsearch-default-*] matching patterns from existing composable templates [.deprecation-indexing-template] with patterns (.deprecation-indexing-template => [.logs-deprecation.*]); this template [.logs-deprecation.elasticsearch-default] may be ignored in favor of a composable template at index creation time
[2022-01-22T15:30:10,296][INFO ][o.e.c.m.MetadataIndexTemplateService] [`Preformatted text`elastic] adding template [.logs-deprecation.elasticsearch-default] for index patterns [.logs-deprecation.elasticsearch-default-*]
VamPikmin
(Vam Pikmin)
February 14, 2022, 9:52am
7
Upgraded to 8.0.0 and my node is still yellow, the other thread I opened has been closed
Anyone else that can help us with this?
@Toby-Elastic
Sorry, I tried to follow but unsure how to fix?
opened 11:24AM - 03 Nov 21 UTC
closed 12:28PM - 09 Nov 21 UTC
>bug
:Delivery/Packaging
:Core/Infra/Logging
:Data Management/Data streams
Team:Core/Infra
Team:Data Management
Team:Delivery
v7.16.0
The problem probably affects docker distribution only.
deprecation log data… stream is created in 7.16 with following index template
`deprecation-indexing-template.json`
```
{
"index_patterns": [".logs-deprecation.*"],
"priority": 1000,
"data_stream": {
"hidden": true
},
"composed_of": [
".deprecation-indexing-mappings",
".deprecation-indexing-settings"
],
"allow_auto_create": true,
"_meta": {
"description": "default template for Stack deprecation logs index template installed by x-pack",
"managed": true
},
"version": ${xpack.deprecation.indexing.template.version}
}
```
`deprecation-indexing-settings.json`
```
{
"template": {
"settings": {
"index": {
"hidden" : true,
"auto_expand_replicas" : "0-1",
"lifecycle": {
"name": ".deprecation-indexing-ilm-policy"
},
"codec": "best_compression",
"query": {
"default_field": ["message"]
}
}
}
},
"_meta": {
"description": "default settings for Stack deprecation logs index template installed by x-pack",
"managed": true
},
"version": ${xpack.deprecation.indexing.template.version}
}
```
when a 7.16 instance is freshly started `deprecation log datastream` results with correct settings
`/.logs-deprecation.elasticsearch-default/_settings`
```
{
".ds-.logs-deprecation.elasticsearch-default-2021.11.03-000001": {
"settings": {
"index": {
"lifecycle": {
"name": ".deprecation-indexing-ilm-policy"
},
"codec": "best_compression",
"routing": {
"allocation": {
"include": {
"_tier_preference": "data_hot"
}
}
},
"hidden": "true",
"number_of_shards": "1",
"auto_expand_replicas": "0-1",
"provided_name": ".ds-.logs-deprecation.elasticsearch-default-2021.11.03-000001",
"query": {
"default_field": [
"message"
]
},
"creation_date": "1635937224704",
"number_of_replicas": "0",
"uuid": "PnjN0oe6Ro6gQYNGAFcVrg",
"version": {
"created": "7160099"
}
}
}
}
}
```
However if a 6.8 is created first, then the same data path is used to start 7.16 (upgrade process) then the deprecation log data stream (is is being created in 7.16) has incorrect settings (just default)
`/.logs-deprecation.elasticsearch-default/_settings`
```
{
".logs-deprecation.elasticsearch-default": {
"settings": {
"index": {
"routing": {
"allocation": {
"include": {
"_tier_preference": "data_content"
}
}
},
"number_of_shards": "1",
"provided_name": ".logs-deprecation.elasticsearch-default",
"creation_date": "1635936542141",
"number_of_replicas": "1",
"uuid": "plhubVeTRGuQanEOUbQTog",
"version": {
"created": "7160099"
}
}
}
}
}
```
STEPS TO REPRODUCE
docker pull docker.elastic.co/elasticsearch/elasticsearch:6.8.17
docker pull docker.elastic.co/elasticsearch/elasticsearch:7.16.0-SNAPSHOT
mkdir local_data docker run -v local_data:/usr/share/elasticsearch/data -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.8.17
docker run -v /Users/przemek/scratch/upgrade_6.8_7.16_docker/local_data:/usr/share/elasticsearch/data -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.16.0-SNAPSHOT
confirm settings with
```
curl --request GET \
--url http://localhost:9200/.logs-deprecation.elasticsearch-default/_settings
```
for tar distribution this works fine
start 6.8 from tar
copy data dir to 7.16
start 7.16 and observer deprecation log with correct settings
cc: @david-kow @pebrc
I found the the component template .deprecation-indexing-settings
.
However, I am unable to update it.
$ curl 'http://localhost:9200/_component_template/.deprecation-indexing-settings'
{"component_templates":[{"name":".deprecation-indexing-settings","component_template":{"template":{"settings":{"index":{"lifecycle":{"name":".deprecation-indexing-ilm-policy"},"codec":"best_compression","hidden":"true","auto_expand_replicas":"0-1","query":{"default_field":["message"]}}}},"version":1,"_meta":{"managed":true,"description":"default settings for Stack deprecation logs index template installed by x-pack"}}}]}
$ curl 'http://localhost:9200/_component_template/.deprecation-indexing-settings' -X PUT -H Content-Type:application/json --data '{"template":{"settings":{"index":{"lifecycle":{"name":".deprecation-indexing-ilm-policy"},"codec":"best_compression","hidden":"true","number_of_replicas":"0","auto_expand_replicas":"0-1","query":{"default_field":["message"]}}}}}'
{"acknowledged":true}
$ curl 'http://localhost:9200/_component_template/.deprecation-indexing-settings'
{"component_templates":[{"name":".deprecation-indexing-settings","component_template":{"template":{"settings":{"index":{"lifecycle":{"name":".deprecation-indexing-ilm-policy"},"codec":"best_compression","hidden":"true","auto_expand_replicas":"0-1","query":{"default_field":["message"]}}}},"version":1,"_meta":{"managed":true,"description":"default settings for Stack deprecation logs index template installed by x-pack"}}}]}
What's going on here?
VamPikmin
(Vam Pikmin)
February 18, 2022, 1:56am
9
Thanks for that, I didn't realize component templates are separated from the old _template
When I check the settings on my server it looks to have the correct settings
curl -XGET -k -u elastic:$pass https://localhost:9200/.logs-deprecation.elasticsearch-default/_settings?pretty
{
".ds-.logs-deprecation.elasticsearch-default-2022.01.17-000001" : {
"settings" : {
"index" : {
"lifecycle" : {
"name" : ".deprecation-indexing-ilm-policy",
"indexing_complete" : "true"
},
"codec" : "best_compression",
"routing" : {
"allocation" : {
"include" : {
"_tier_preference" : "data_hot"
}
}
},
"hidden" : "true",
"number_of_shards" : "1",
"auto_expand_replicas" : "0-1",
"provided_name" : ".ds-.logs-deprecation.elasticsearch-default-2022.01.17-000001",
"query" : {
"default_field" : [
"message"
]
},
"creation_date" : "1642378528109",
"number_of_replicas" : "0",
"uuid" : "ejvRQCjMSs6QP7MGnJsNzg",
"version" : {
"created" : "7160399"
}
}
}
},
VamPikmin
(Vam Pikmin)
February 18, 2022, 8:03am
10
@OrangeDog
This one worked for me
curl -XPUT -k -u elastic:$pass "https://localhost:9200/_component_template/.deprecation-indexing-settings" -H 'Content-Type: application/json' -d '{"template":{"settings":{"index":{"lifecycle":{"name":".deprecation-indexing-ilm-policy"},"codec":"best_compression","hidden":"true","number_of_replicas":"0","auto_expand_replicas":"0-1","query":{"default_field":["message"]}}}},"version":1,"_meta":{"managed":true,"description":"default settings for Stack deprecation logs index template installed by x-pack"}}}'
Note: First I've tried this one and changed the version number but it completely overwrote my settings so be careful!
curl -XPUT -k -u elastic:$pass "https://localhost:9200/_component_template/.deprecation-indexing-settings" -H 'Content-Type: application/json' -d '{"template": {"settings": {"number_of_replicas": 0}},"version":2}'
All of my data streams are yellow, would be nice if someone could show us how to change the stream defaults to zero replicas like in the past with deprecated templates
system
(system)
Closed
March 18, 2022, 8:04am
11
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.