# Load balancing issues on cluster while indexing

**URL:** <https://discuss.elastic.co/t/load-balancing-issues-on-cluster-while-indexing/8879>\
**Category:** Elasticsearch\
**Created:** [August 29, 2012, 12:33pm UTC](https://discuss.elastic.co/t/load-balancing-issues-on-cluster-while-indexing/8879 "2012-08-29T12:33:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Glyton\_Camilleri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/glyton_camilleri/32/2743_2.png) [@Glyton\_Camilleri](https://discuss.elastic.co/u/Glyton_Camilleri)\
**Post date:** [August 29, 2012, 12:33pm UTC](https://discuss.elastic.co/t/load-balancing-issues-on-cluster-while-indexing/8879/1 "2012-08-29T12:33:34Z")

</div>

Hi,

I am trying to index data on a 20 node cluster using the Bulk API through  
the Java client in my application. After running my application for some  
time, BigDesk shows that the load is taken mostly by a single node on the  
cluster. I tried indexing my data in the two following ways:

1. Added all the hosts and ports to the client using the addTransportAddresses  
on the TransportClient instance (this should distribute the requests in a  
RoundRobin fashion)
2. Setting the master's node.data configuration setting to false and  
sending all bulk requests to the master node.

In both cases, i could see that the number of IndexRequests reported by  
BigDesk is extremely high on one node, and 0 (or close to 0) on the  
remainder of the cluster. Note that my client, does not use sniffing that  
the cluster is unable to use Multicast (all hosts and ports are configured  
in Unicast configuration).

Has anyone ever experienced this issue? And is there a way to ensure a  
uniform distribution of load on the cluster?

Thanks in advance!

--

---

<div class="post-metadata">

**Author:** ![Glyton\_Camilleri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/glyton_camilleri/32/2743_2.png) [@Glyton\_Camilleri](https://discuss.elastic.co/u/Glyton_Camilleri)\
**Post date:** [August 29, 2012, 3:01pm UTC](https://discuss.elastic.co/t/load-balancing-issues-on-cluster-while-indexing/8879/2 "2012-08-29T15:01:09Z")

</div>

As an update: this issue seems to be related to

[http://elasticsearch-users.115913.n3.nabble.com/Document-ALWAYS-Routes-to-ONE-Shard-when-BULK-Loading-HELP-td4022020.html](http://elasticsearch-users.115913.n3.nabble.com/Document-ALWAYS-Routes-to-ONE-Shard-when-BULK-Loading-HELP-td4022020.html)

I have tried using a different ID and i still get the same result using  
version 0.19.8.

Any suggestions?

--

---

<div class="post-metadata">

**Author:** ![Glyton\_Camilleri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/glyton_camilleri/32/2743_2.png) [@Glyton\_Camilleri](https://discuss.elastic.co/u/Glyton_Camilleri)\
**Post date:** [August 30, 2012, 1:34pm UTC](https://discuss.elastic.co/t/load-balancing-issues-on-cluster-while-indexing/8879/3 "2012-08-30T13:34:56Z")

</div>

Fixed this and managed to index all the data. The solution to my problem  
was to set a Base64 encoded randomly generated UUID as ID, and then simply  
route each document by that value. The load was pretty much uniformly  
distributed across all shards.

--

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:14am UTC](https://discuss.elastic.co/t/load-balancing-issues-on-cluster-while-indexing/8879/4 "2017-07-06T03:14:34Z")

</div>

Closed on July 6, 2017, 3:14am UTC


