# Sync local Elasticsearch index with remote Elasticsearch continuously

**URL:** <https://discuss.elastic.co/t/sync-local-elasticsearch-index-with-remote-elasticsearch-continuously/233708>\
**Category:** Elasticsearch\
**Created:** [May 21, 2020, 9:31am UTC](https://discuss.elastic.co/t/sync-local-elasticsearch-index-with-remote-elasticsearch-continuously/233708 "2020-05-21T09:31:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abolurah](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abolurah/32/68804_2.png) [@Abolurah](https://discuss.elastic.co/u/Abolurah)\
**Post date:** [May 21, 2020, 9:31am UTC](https://discuss.elastic.co/t/sync-local-elasticsearch-index-with-remote-elasticsearch-continuously/233708/1 "2020-05-21T09:31:39Z")

</div>

Hi All,  
I have local Elasticsearch that collects a lot of data into the index lets call it eventIndex.  
My goal is to move this data from "localEventIndex" to the remote Elasticsearch "remoteEventIndex" index.  
I made some POC with Logstash that sends the data to the remote Elasticsearch index and marking it as "uploaded" for avoiding additional upload of same document. It works OK , but if there will be some connection issues, some documents may be sent twice or more, in other words there is no 100% data accuracy insurance in this case.  
I'm wondering maybe there are some other nice solutions that I can use in order to move data from local Index to remote index with high accuracy.  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [May 21, 2020, 9:57am UTC](https://discuss.elastic.co/t/sync-local-elasticsearch-index-with-remote-elasticsearch-continuously/233708/2 "2020-05-21T09:57:00Z")

</div>

That is exactly what [cross-cluster replication](https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-ccr.html) was created for. It does require a commercial license though. Before this was available a common approach was to use a message queue and have two consumers writing to different clusters.

---

<div class="post-metadata">

**Author:** ![Abolurah](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abolurah/32/68804_2.png) [@Abolurah](https://discuss.elastic.co/u/Abolurah)\
**Post date:** [May 21, 2020, 10:58am UTC](https://discuss.elastic.co/t/sync-local-elasticsearch-index-with-remote-elasticsearch-continuously/233708/3 "2020-05-21T10:58:03Z")

</div>

Thanks for the answer @Christian_Dahlqvist

If I'm not wrong " [cross-cluster replication] [https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-ccr.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/xpack-ccr.html))" works on "PULL" mechanism from the remote on a local server, in my case "PUSH" mechanism from local to remote is preferred, also as open-source.  
maybe there are other solutions ?(beside message ques with 2 writing consumers)

Thanks

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [May 21, 2020, 11:14am UTC](https://discuss.elastic.co/t/sync-local-elasticsearch-index-with-remote-elasticsearch-continuously/233708/4 "2020-05-21T11:14:49Z")

</div>

I am not aware of any open-source solution.

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [May 21, 2020, 12:36pm UTC](https://discuss.elastic.co/t/sync-local-elasticsearch-index-with-remote-elasticsearch-continuously/233708/5 "2020-05-21T12:36:21Z")

</div>

I don't understand the distinction you're making between "PULL" and "PUSH" mechanisms, or at least I don't understand why it's meaningful to you. Can you explain why CCR's mechanism doesn't work for you? Although it's technically a pull-based mechanism it uses long-polling so it's functionally much more like a push.

---

<div class="post-metadata">

**Author:** ![Abolurah](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/abolurah/32/68804_2.png) [@Abolurah](https://discuss.elastic.co/u/Abolurah)\
**Post date:** [May 21, 2020, 1:54pm UTC](https://discuss.elastic.co/t/sync-local-elasticsearch-index-with-remote-elasticsearch-continuously/233708/6 "2020-05-21T13:54:54Z")

</div>

@DavidTurner Thanks  
The thing is that local ES is at customer site, when remote ES is on Cloud.  
We can’t open the customer site for to allow HTTP requests from Cloud. So we need to run Logstash or something else on the customer side. To query data from the local ES and to push to the remote ES.  
Thanks

---

<div class="post-metadata">

**Author:** ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)\
**Post date:** [May 21, 2020, 2:01pm UTC](https://discuss.elastic.co/t/sync-local-elasticsearch-index-with-remote-elasticsearch-continuously/233708/7 "2020-05-21T14:01:52Z")

</div>

I see, thanks. This is surmountable with a bit of network shenanigans (a VPN or some other kind of tunnel) but I can see how it's a bit of an obstacle.

---

<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:** [June 18, 2020, 2:01pm UTC](https://discuss.elastic.co/t/sync-local-elasticsearch-index-with-remote-elasticsearch-continuously/233708/8 "2020-06-18T14:01:52Z")

</div>

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