Elasticsearch 8 single node replicas 0

Nice work, I've been playing with those too- in Component Templates I do a search for settings and changed them all

With my setup I've had issues with filebeat creating a new index with every upgrade with replica of 1 (filebeat-8.0.0, filebeat-8.0.1,etc)

I've realized last night these come from the filebeat.yml so I specifically added replicas zero there
I can't really test unless I delete the data :confused: or wait until next release :slight_smile:

# ======================= Elasticsearch template setting =======================
setup.template.settings:
  index.number_of_shards: 1
  index.number_of_replicas: 0

Setting up a default with the following settings didn't work for filebeat possible because I haven't made the above change, even though default template is getting picked up

curl -XPUT -k -u elastic:$pass https://localhost:9200/_index_template/default -d '{"index_patterns":["*"],"template":{"settings":{"index":{"number_of_replicas":"0"}}},"composed_of":[],"priority":90000000,"_meta":{"description":"b7-default"},"data_stream":{"hidden":false,"allow_custom_routing":false}}}' -H 'Content-Type: application/json'

image

I tried to delete the template I made by changing the default template from * to something not existent as was suggested in the previous post (github link) but I was unable to because .fleet-actions-results doesn't have a template, so I had to create it with a priority of 90000001

In any case I don't recommend doing any of this, everything I read so far suggests that setting up a template with * is a bad thing, and looks like setting it up with * and negating the . (to not include hidden indices in the template is not working, there's a github issue open for that.
It would be so much simpler if there was something in Elasticsearch.yml to set replica settings globally :smiley: and not have to worry about it

curl -XPUT -k -u elastic:$pass https://localhost:9200/_index_template/default -d '{"index_patterns":["whatever"],"template":{"settings":{"index":{"number_of_replicas":"0"}}},"composed_of":[],"priority":90000000,"_meta":{"description":"b7"},"data_stream":{"hidden":false,"allow_custom_routing":false}}}' -H 'Content-Type: application/json'
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"composable template [default] with index patterns [b7], priority [90000000] would cause data streams [.fleet-actions-results] to no longer match a data stream template"}],"type":"illegal_argument_exception","reason":"composable template [default] with index patterns [b7], priority [90000000] would cause data streams [.fleet-actions-results] to no longer match a data stream template"},"status":400}