Federation - Fixed Index/Shard Allocation

I understand the HA feature of ES will not be used, with what i am trying.

  • I want the index to be tied to the nodes where they were created. And
    not available when the node is down.
  • Trying to create a cluster of ES nodes, I want each node to have its
    own index/shard (no allocation). For now probably without a replica.
  • The index updates are local to the node. The CUD operations on the
    node to be distributed. While i want the queries to occur on all indexes.

I have tried to use the cluster.routing.allocation.enable- Set to none.

Node 98 - Create an index "98" using /node98:9200/_plugin/head
Node 229 - Create an index "229 using /node229:9200/_plugin/head

Both nodes have the above settings to "none" in the elasticsearch.yml file."

  • I am trying to achieve "98" index to be placed on "node 98" and not
    moved. The same with "229" on "node 229"
  • But both the indexes are "unassigned".
    cluster.routing.allocation.enable:all assigns the shards to random nodes.

Is there a to automatically achieve it without the "zone" allocation?
Because, i dont want any shard allocation dynamically.

-Vidhya

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/87d01e08-6e3d-4991-82a3-8c57a7da72f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

I was able to achieve it myself. In case it might be useful for someone
else looking for an answer.

Found 2 ways of doing it.

  1. Disable cluster routing and manually assign index to a node

    • cluster.routing.allocation.enable: none
    • POST _cluster/reroute
      {
      "commands" : [
      {
      "allocate" : {
      "index" : "98", "shard" : 0, "node" : "Amphibius",
      "allow_primary":true
      }
      }
      ]
      }
  2. Using routing

http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/index-modules-allocation.html
This will make sure the index is created only on a node with a specific
tag.

  • cluster.routing.allocation.enable:"all"
  • set the node.tag.. say appUUID229, and create an index with
    appropriate routing
    GET /229
    {
    "number_of_shards" : 1,
    "number_of_replicas" : 0,
    "index.routing.allocation.include.tag":"appUUID229"
    }

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/6e4b75b0-7a48-4c3a-accf-bd17f406d2e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.