cawoodm
(Marc)
September 11, 2018, 6:54am
1
All our indices were "yellow" and we discovered it's because the number of replicas was set to 1. When we update the number of replicas to 0 the indexes are green.
Because we periodically re-create our indices and re-index them we added the following to our index creation:
{
"index" : {
"number_of_replicas" : 0
},
"mappings": {
"doc": {
"properties": {
...
However, such indices are still created with number_of_replicas = 1 as is visible in: GET /_cat/indices
:
health status index uuid pri rep docs.count
yellow open logs-test1 ... 5 1 3316531
Why does ES set 1 by default? Sounds wrong.
Why does ES ignore the 0 when we create the index?
It is because the default is always one
as you are only having one instance thats why the status is yellow
cawoodm
(Marc)
September 11, 2018, 6:59am
3
Why is the default 1? => Because it is 1. OK, that's cleared that up for us.
Please show exactly how you create the index.
cawoodm
(Marc)
September 11, 2018, 8:02am
5
PUT /logs-test1
{
"index" : {
"number_of_replicas" : 0
},
"mappings": {
"doc": {
"properties": {
"category": {"type": "keyword"},
"id": {"type": "long"},
"subcategory": {"type": "keyword"},
"timestamp": {"type": "date","format": "date_time||epoch_millis"},
"type": {"type": "keyword"}
}
}
}
}
You are missing the settings
level, which is why your settings are not recognised:
PUT /logs-test1
{
"settings": {
"index" : {
"number_of_replicas" : 0
}
},
"mappings": {
"doc": {
"properties": {
"category": {"type": "keyword"},
"id": {"type": "long"},
"subcategory": {"type": "keyword"},
"timestamp": {"type": "date","format": "date_time||epoch_millis"},
"type": {"type": "keyword"}
}
}
}
}
system
(system)
Closed
October 9, 2018, 8:21am
8
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.