Shards not balanced across four nodes


(T J Yang) #1

Hi

  • I ran into 3 shards un-assigned issue so I ran following elasticsearch command to disable the replica number from 1 to 0.

[root@syslog01 ~]# cat disable_replica.bash
curl -XPUT ‘http://syslog01.test.com:9200/_settings’ -d ‘{“index” : {“number_of_replicas” : 0}}’
[root@syslog01 ~]#

  • Now my elasticsearch turned back to green(from yellow).
  • This problem is that 0-1-2-3 shards are not balanced across 4 nodes. See following.

  • Question 1 is why the shards are not balanced out across when replica setting is “0” ?
  • Question 2 is what is the elasticsearch command to spread "0"s to other nodes ?

(Jan Doberstein) #2
  • answer 1: that can be configured in ES - depending on the Version that is a little different.
  • answer 2: it will automatically distributed to all nodes that are part of the cluster and hold indices.

(T J Yang) #3

@jan

Thanks for the lighting response to my question.

  • I am using elasticsearch supported by graylog “Graylog v2.4.3+2c41897”.

[root@syslog01 ~]# rpm -qa |grep elastic
elasticsearch-5.6.5-1.noarch
[root@syslog01 ~]#

  • “it will automatically distributed to all nodes that are part of the cluster and hold indices.”
    • Does this mean I can just wait it out then “0” and “3” shards will be distributed eventually ?
    • Is there a command to speed it up ?

(Jan Doberstein) #4

you can get a balance with some some commands to the elasticsearch index. The important would be cluster.routing.allocation.same_shard.host and then you need to force a rebalance. The following doc can help you.

https://www.elastic.co/guide/en/elasticsearch/reference/current/shards-allocation.html#_shard_balancing_heuristics


(system) #5

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.