# Sending data to Multiple elasticsearch containers

**URL:** <https://discuss.elastic.co/t/sending-data-to-multiple-elasticsearch-containers/270532>\
**Category:** Elasticsearch\
**Tags:** docker\
**Created:** [April 19, 2021, 5:08am UTC](https://discuss.elastic.co/t/sending-data-to-multiple-elasticsearch-containers/270532 "2021-04-19T05:08:50Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![safura\_zaheer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/safura_zaheer/32/87292_2.png) [@safura\_zaheer](https://discuss.elastic.co/u/safura_zaheer)\
**Post date:** [April 19, 2021, 5:08am UTC](https://discuss.elastic.co/t/sending-data-to-multiple-elasticsearch-containers/270532/1 "2021-04-19T05:08:50Z")

</div>

Hi all,  
I am having 3 docker containers of elasticsearch running on a single host on different ports, Now I want to send data to all the 3 containers so that I don't have any single point of failure . What are the different strategies of sending data ?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 19, 2021, 7:44am UTC](https://discuss.elastic.co/t/sending-data-to-multiple-elasticsearch-containers/270532/2 "2021-04-19T07:44:18Z")

</div>

Welcome!

Normally clients are supporting multiple nodes so they will be able to switch to the next node and isolate the faulty node if needed.

What is sending the data to elasticsearch ?

---

<div class="post-metadata">

**Author:** ![safura\_zaheer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/safura_zaheer/32/87292_2.png) [@safura\_zaheer](https://discuss.elastic.co/u/safura_zaheer)\
**Post date:** [April 19, 2021, 8:03am UTC](https://discuss.elastic.co/t/sending-data-to-multiple-elasticsearch-containers/270532/3 "2021-04-19T08:03:16Z")

</div>

That is what I want to know, what should I use to send data to elasticsearch containers .

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 19, 2021, 9:16am UTC](https://discuss.elastic.co/t/sending-data-to-multiple-elasticsearch-containers/270532/4 "2021-04-19T09:16:43Z")

</div>

What are you doing with Elasticsearch? Logs? Search feature from your application? Which programming language?

---

<div class="post-metadata">

**Author:** ![safura\_zaheer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/safura_zaheer/32/87292_2.png) [@safura\_zaheer](https://discuss.elastic.co/u/safura_zaheer)\
**Post date:** [April 19, 2021, 9:29am UTC](https://discuss.elastic.co/t/sending-data-to-multiple-elasticsearch-containers/270532/5 "2021-04-19T09:29:41Z")

</div>

I have to store the logs on multiple containers so that if one goes down, I have the backup.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 19, 2021, 10:13am UTC](https://discuss.elastic.co/t/sending-data-to-multiple-elasticsearch-containers/270532/6 "2021-04-19T10:13:09Z")

</div>

What tool is sending logs to elasticsearch?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [April 19, 2021, 1:58pm UTC](https://discuss.elastic.co/t/sending-data-to-multiple-elasticsearch-containers/270532/7 "2021-04-19T13:58:26Z")

</div>

Could you please clarify

Are these "containers"

1. different nodes that belong to 1 elasticsearch cluster?

2. each is it one 1 single node elasticsearch cluster?

---

<div class="post-metadata">

**Author:** ![safura\_zaheer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/safura_zaheer/32/87292_2.png) [@safura\_zaheer](https://discuss.elastic.co/u/safura_zaheer)\
**Post date:** [April 22, 2021, 7:23am UTC](https://discuss.elastic.co/t/sending-data-to-multiple-elasticsearch-containers/270532/8 "2021-04-22T07:23:06Z")

</div>

Yes, these are 3 containers of elasticsearch .

1. Yes, these 3 nodes belong to one cluster.
2. Nope, it is a 3 node elasticsearch cluster

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [April 22, 2021, 1:49pm UTC](https://discuss.elastic.co/t/sending-data-to-multiple-elasticsearch-containers/270532/10 "2021-04-22T13:49:36Z")

</div>

> [@safura\_zaheer](#):
>
> Yes, these are 3 containers of elasticsearch .
> 
> 1. Yes, these 3 nodes belong to one cluster.
> 2. Nope, it is a 3 node elasticsearch cluster

So since the nodes are all part of the same cluster.

1. assuming you use the default of 1 primary and 1 replica shards the data will automatically be distributed across the nodes and the primary and replica shards will never be on the same node so you will have HA with respect if the data if you lose 1 container. Elasticsearch does this automatically for you.

2. what I described above will happen even if you send the data to one node because Elasticsearch us a distributed data store. Do not try to send copies of same data to each node.

3. for HA of sending the data to the cluster depending on the tool / which you have not told us the are methods to "load balance" the sending of the data.

Which tool are you using to send the data.

---

<div class="post-metadata">

**Author:** ![safura\_zaheer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/safura_zaheer/32/87292_2.png) [@safura\_zaheer](https://discuss.elastic.co/u/safura_zaheer)\
**Post date:** [April 23, 2021, 6:14am UTC](https://discuss.elastic.co/t/sending-data-to-multiple-elasticsearch-containers/270532/11 "2021-04-23T06:14:48Z")

</div>

I'm using Logstash and logstash is getting data via filebeat.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 23, 2021, 7:58am UTC](https://discuss.elastic.co/t/sending-data-to-multiple-elasticsearch-containers/270532/12 "2021-04-23T07:58:00Z")

</div>

So have a look at [Elasticsearch output plugin | Logstash Reference [7.12] | Elastic](https://www.elastic.co/guide/en/logstash/current/plugins-outputs-elasticsearch.html#plugins-outputs-elasticsearch-hosts)

It allows to pass multiple hosts.

---

<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:** [May 21, 2021, 7:58am UTC](https://discuss.elastic.co/t/sending-data-to-multiple-elasticsearch-containers/270532/13 "2021-05-21T07:58:01Z")

</div>

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