# Java client connection question

**URL:** <https://discuss.elastic.co/t/java-client-connection-question/9908>\
**Category:** Elasticsearch\
**Created:** [November 30, 2012, 8:40pm UTC](https://discuss.elastic.co/t/java-client-connection-question/9908 "2012-11-30T20:40:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vinicius\_Carvalho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vinicius_carvalho/32/770_2.png) [@Vinicius\_Carvalho](https://discuss.elastic.co/u/Vinicius_Carvalho)\
**Post date:** [November 30, 2012, 8:40pm UTC](https://discuss.elastic.co/t/java-client-connection-question/9908/1 "2012-11-30T20:40:29Z")

</div>

Hi there.

I'm doing some tests here, and before executing a bulk index in my cluster  
(2 nodes, replica =1) I set the index\_refresh\_interval = -1.

I later connect to one of the nodes by using the transport client point to  
host:9300.

I was expecting that only that node, would have the data inserted (since  
I've set the interval to -1) Isn't this the case?

I'm trying to come up with a good solution to index a lot of data on live  
environment without having to penalize the live nodes. Trying to synch all  
data to one node first, and then let it replicate to the others. Any  
advices on this?

Regards

--

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [December 1, 2012, 12:32am UTC](https://discuss.elastic.co/t/java-client-connection-question/9908/2 "2012-12-01T00:32:58Z")

</div>

Hi Vinicius,

you always ingest the data to the nodes that hold the shards of the index,  
as long as you don't care for routing,  
see [http://www.elasticsearch.org/guide/reference/api/index\_.html](http://www.elasticsearch.org/guide/reference/api/index_.html)

But, explicit routing is the exception. Think of Elasticsearch of a  
multi-node system that was invented to distribute the load over your nodes  
automatically. No manual intervention required. You won't need to care  
about indexing that can penalize search. If your load rises, add more  
nodes. It's that easy.

Only for exceptional situations, you may consider shard placement control  
and other techniques, move parts of an index, avoiding hot spots etc.

For baseline ingesting, just set up primary shards for faster data loading.  
After ingesting is done, add a replica level to the shards.

Best regards,

Jörg

--

---

<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:01am UTC](https://discuss.elastic.co/t/java-client-connection-question/9908/3 "2017-07-06T03:01:54Z")

</div>

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


