0

I regularly resolve unassigned replicas messages with the curl command from another post that removes all replicas: ElasticSearch: Unassigned Shards, how to fix?

curl -XPUT localhost:9200/_settings -d '{ "number_of_replicas" :0 }'

I have run the curl commands to configure automatic allocation, but it doesn't resolve.

curl -XPUT 'localhost:9200/_cluster/settings' -d '{ "transient" : { "cluster.routing.allocation.enable" : "all" } }'

  • Why is my single node AWS-AMI Graylog 2.0 server generating replicas without assigning them?
  • Why is the curl command configuring it to do so not applying?
Community
  • 1
  • 1
  • Do you see any errors or warnings in your `graylog-server` or Elasticsearch logs? – Lennart Koopmann Jun 28 '16 at 18:58
  • Nothing helpful. What interests me is the response from elasticsearch seems fine. `{"acknowledged":true,"persistent":{},"transient":{"cluster":{"routing":{"allocation":{"enable":"all"}}}}}` – razumzhiro Jun 29 '16 at 18:35

1 Answers1

0

Why is my single node AWS-AMI Graylog 2.0 server generating replicas without assigning them?

Elasticsearch indexes default to have a single replica. However, you cannot allocate a shard replica with only a single node.

If you could, then the replica would be on the same machine and doubling down to use the same memory, twice. That's not at all what you want, so it simply does not allocate.

how do I best respond that doesn't require regular replica clearing?

The general approach is to either:

  • Modify an application setting wherever the index is created to change the number of replicas that it uses. Not all applications provide a setting to do this and it's completely dependent on their setup.
  • Change any existing template to not expect a replica.
    • This implies that the template won't be replaced by the system that put it there (again, depends on the system).
  • Create a global template that defaults the number of replicas to 0.

In the case of the template, the difference between the second and third option is how global the template is:

{
  "template" : "*",
  "settings" : {
    "number_of_replicas" : 0
  }
}

Note: you should not set global mappings, but global settings are perfectly fine.

pickypg
  • 20,592
  • 4
  • 65
  • 79