On 7/16/2015 7:47 AM, solr.user.1...@gmail.com wrote: > Thanks Shawn, but don't want to build something in front of Solr cloud to > help Solr assign leader role to distribute load of indexing. > > Instead of doing this manual step (rebalance leaders) maybe one host should > not take the leader role of multiple shards for same collection if the number > of live nodes are equal to number of shards. > > But assuming that when you say it will happen "over time", Maybe I'll > continue indexing and see that leaders will be rebalanced soon.
Unless you have a fairly major event (like Solr restarting or an operation taking longer than zkClientTimeout) your leaders will never change. It's a semi-permanent role. When a qualifying event happens, SolrCloud does an election process to determine the leader, but elections do not happen unless you force them with a REBALANCELEADERS action or one of several errors occurs. You don't have to build anything in front of Solr. You simply have to assign a preferred leader for each shard, an action that can be done with an HTTP call in a browser. I don't think we have anything in the admin UI to assign preferred leaders ... I will look into it and open an issue if necessary. The thing that I'm saying will happen over time is that all replicas will be used for queries. If you send a thousand queries, you'll find that they will be divided fairly evenly among all replicas. The fact that you have one node as leader for three of your shards is not very much of a big deal, but if you really want to change it, you can do so with the preferred leader feature. Thanks, Shawn