Skip to content

Force smooth shard allocation #5748

@nik9000

Description

@nik9000

So I have one index that will get tons more traffic then all the others. For that reason its pretty important that its shards get spread out reasonably evenly even in the face of things like rolling restarts, failed nodes, and the like. I'm pretty sure the distribution is reasonably random right now. Could Elasticsearch bias towards smoothly distributing the shards?

This came up because I started load testing Elasticsearch and saw this:
bad_distribution
That is, elastic1003 isn't seeing any load at all and elastic105 and elastic1011 aren't shouldering their fair share.

On digging, I got this:

manybubbles@elastic1008:~$ curl -s 'localhost:9200/_cat/shards/enwiki_content_1395837666' | perl -pe 's/.*(elastic.*)/\1/' | sort | uniq -c 
      3 elastic1001 
      2 elastic1002 
      2 elastic1004 
      1 elastic1005 
      3 elastic1006 
      3 elastic1007 
      4 elastic1008 
      3 elastic1009 
      2 elastic1010 
      1 elastic1011 
      4 elastic1012 
      3 elastic1013 
      3 elastic1014 
      3 elastic1015 
      3 elastic1016 

Which shows that elastic1003 doesn't have any of the shards and elastic1005 and elastic1011 only have one each.

Annoying work around: I can use the allocation api to shift shards from the nodes with more to the nodes with fewer. It'd be much better if it were automatic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions