# Elasticsearch river and mongodb replica

**URL:** https://discuss.elastic.co/t/elasticsearch-river-and-mongodb-replica/9448
**Category:** Elasticsearch
**Created:** [October 23, 2012, 5:03pm UTC](https://discuss.elastic.co/t/elasticsearch-river-and-mongodb-replica/9448 "2012-10-23T17:03:12Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Robbie\_Cheng](https://avatars.discourse-cdn.com/v4/letter/r/d26b3c/32.png) [@Robbie\_Cheng](https://discuss.elastic.co/u/Robbie_Cheng)
#### Post date: [October 23, 2012, 5:03pm UTC](https://discuss.elastic.co/t/elasticsearch-river-and-mongodb-replica/9448/1 "2012-10-23T17:03:12Z")

</div>

According to the documentation of elasticsearch river to mongodb. It  
requires oplog to pull data from mongo. We tired to run a replication  
set with single node (yes, cheating) instructed by the following url:

> **[How to get a MongoDB oplog without a full replica set](https://loosexaml.wordpress.com/2012/09/03/how-to-get-a-mongodb-oplog-without-a-full-replica-set/)**
>
> The MongoDB oplog is a rolling log of the most recent operations that occurred in a MongoDB instance. It’s intended for replication so that multiple data nodes can follow the oplog and immedi…

And it looks like river pulls data from mongodb successfully, but we  
would like to know more detail since we only spotted 2 records in  
oplog, how does river pull existing data from replication set? And is  
there any dependency of creating replication set in mongodb, and  
hooking up ES and mongodb with river? I mean, if we have running  
replication set, and we hook it up with ES afterwards, what happen to  
those existing data? Will they be pulled, too?

Thanks,

--

---

<div class="post-metadata">

### Author: ![Richard\_Louapre](https://avatars.discourse-cdn.com/v4/letter/r/e19adc/32.png) [@Richard\_Louapre](https://discuss.elastic.co/u/Richard_Louapre)
#### Post date: [November 5, 2012, 8:22am UTC](https://discuss.elastic.co/t/elasticsearch-river-and-mongodb-replica/9448/2 "2012-11-05T08:22:45Z")

</div>

Hi,

You can find more details oplog and internal replication in MongoDB here  
[1].  
This is how currently the data are pulled from mongo inot ES.

[1] - [Replication Internals – Kristina Chodorow's Blog](http://www.kchodorow.com/blog/2010/10/12/replication-internals/)

Thanks,  
Richard.

On Tuesday, October 23, 2012 1:03:22 PM UTC-4, Robbie Cheng wrote:

> According to the documentation of elasticsearch river to mongodb. It  
> requires oplog to pull data from mongo. We tired to run a replication  
> set with single node (yes, cheating) instructed by the following url:
> 
> [How to get a MongoDB oplog without a full replica set | Loose XAML](http://loosexaml.wordpress.com/2012/09/03/how-to-get-a-mongodb-oplog-without-a-full-replica-set/)
> 
> And it looks like river pulls data from mongodb successfully, but we  
> would like to know more detail since we only spotted 2 records in  
> oplog, how does river pull existing data from replication set? And is  
> there any dependency of creating replication set in mongodb, and  
> hooking up ES and mongodb with river? I mean, if we have running  
> replication set, and we hook it up with ES afterwards, what happen to  
> those existing data? Will they be pulled, too?
> 
> Thanks,

--

---

<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:06am UTC](https://discuss.elastic.co/t/elasticsearch-river-and-mongodb-replica/9448/3 "2017-07-06T03:06:14Z")

</div>


