# Per MongoDB shard per ElasticSearch cluster?

**URL:** <https://discuss.elastic.co/t/per-mongodb-shard-per-elasticsearch-cluster/9454>\
**Category:** Elasticsearch\
**Created:** [October 24, 2012, 3:38am UTC](https://discuss.elastic.co/t/per-mongodb-shard-per-elasticsearch-cluster/9454 "2012-10-24T03:38:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Liang\_Yu\_Chou](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/liang_yu_chou/32/2666_2.png) [@Liang\_Yu\_Chou](https://discuss.elastic.co/u/Liang_Yu_Chou)\
**Post date:** [October 24, 2012, 3:38am UTC](https://discuss.elastic.co/t/per-mongodb-shard-per-elasticsearch-cluster/9454/1 "2012-10-24T03:38:27Z")

</div>

Hello all, I'm trying to incorporate ElasticSearch with our existing  
MongoDB database.  
Currently we have a mongo collection separated to three mongo shards.  
Does that mean I have to use three ElasticSearch clusters for each of them?  
Is there a simpler practice to just use a single ElasticSearch cluster only?

--

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [October 24, 2012, 12:24pm UTC](https://discuss.elastic.co/t/per-mongodb-shard-per-elasticsearch-cluster/9454/2 "2012-10-24T12:24:59Z")

</div>

Hello Liang-Yu,

On Wed, Oct 24, 2012 at 6:38 AM, Liang-Yu Chou [fishlet0528@gmail.com](mailto:fishlet0528@gmail.com) wrote:

> Hello all, I'm trying to incorporate Elasticsearch with our existing MongoDB  
> database.  
> Currently we have a mongo collection separated to three mongo shards.  
> Does that mean I have to use three Elasticsearch clusters for each of them?

You shouldn't need 3 _clusters_. You might need more than one  
Elasticsearch server to handle the load, but that depends on a lot of  
factors, mainly about how your data, queries and hardware look like.

> Is there a simpler practice to just use a single Elasticsearch cluster only?

The easiest way to index data from your MongoDB cluster to an  
Elasticsearch cluster is using the MongoDB river:

> **[GitHub - richardwilly98/elasticsearch-river-mongodb: MongoDB River Plugin for ElasticSearch](https://github.com/richardwilly98/elasticsearch-river-mongodb)**
>
> MongoDB River Plugin for ElasticSearch

There's a nice Wiki there as well, with instructions:

> **[Home](https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki)**
>
> MongoDB River Plugin for ElasticSearch. Contribute to richardwilly98/elasticsearch-river-mongodb development by creating an account on GitHub.

## Best regards, Radu

[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

--

---

<div class="post-metadata">

**Author:** ![Liang\_Yu\_Chou](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/liang_yu_chou/32/2666_2.png) [@Liang\_Yu\_Chou](https://discuss.elastic.co/u/Liang_Yu_Chou)\
**Post date:** [October 25, 2012, 6:50am UTC](https://discuss.elastic.co/t/per-mongodb-shard-per-elasticsearch-cluster/9454/3 "2012-10-25T06:50:36Z")

</div>

Thank you Radu. So you mean I can setup an Elasticsearch cluster and let it  
pull data  
from, in my case, three mongo shards, and write into one single index?  
If yes, that explains a lot. I previously thought I can only specify one  
data source to pull from  
for each Elasticsearch index...

Radu Gheorghe於 2012年10月24日星期三UTC+8下午8時25分03秒寫道：

> Hello Liang-Yu,
> 
> On Wed, Oct 24, 2012 at 6:38 AM, Liang-Yu Chou \<[fishl...@gmail.com](mailto:fishl...@gmail.com)\<javascript:\>\>  
> wrote:
> 
> > Hello all, I'm trying to incorporate Elasticsearch with our existing  
> > MongoDB  
> > database.  
> > Currently we have a mongo collection separated to three mongo shards.  
> > Does that mean I have to use three Elasticsearch clusters for each of  
> > them?
> 
> You shouldn't need 3 _clusters_. You might need more than one  
> Elasticsearch server to handle the load, but that depends on a lot of  
> factors, mainly about how your data, queries and hardware look like.
> 
> > Is there a simpler practice to just use a single Elasticsearch cluster  
> > only?
> 
> The easiest way to index data from your MongoDB cluster to an  
> Elasticsearch cluster is using the MongoDB river:  
> [GitHub - richardwilly98/elasticsearch-river-mongodb: MongoDB River Plugin for ElasticSearch](https://github.com/richardwilly98/elasticsearch-river-mongodb)
> 
> There's a nice Wiki there as well, with instructions:  
> [Home · richardwilly98/elasticsearch-river-mongodb Wiki · GitHub](https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki)
> 
> ## Best regards, Radu
> 
> [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

--

---

<div class="post-metadata">

**Author:** ![radu\_gheorghe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/radu_gheorghe/32/556_2.png) [@radu\_gheorghe](https://discuss.elastic.co/u/radu_gheorghe)\
**Post date:** [October 25, 2012, 8:23am UTC](https://discuss.elastic.co/t/per-mongodb-shard-per-elasticsearch-cluster/9454/4 "2012-10-25T08:23:41Z")

</div>

Hello,

I haven't tested this specific setup, but I don't see why you  
couldn't. You can define multiple rivers, and each river would have  
its own configuration. As for indices, they don't have limitations in  
terms of data source.

## Best regards, Radu

[http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene

On Thu, Oct 25, 2012 at 9:50 AM, Jerry Chou [fishlet0528@gmail.com](mailto:fishlet0528@gmail.com) wrote:

> Thank you Radu. So you mean I can setup an Elasticsearch cluster and let it  
> pull data  
> from, in my case, three mongo shards, and write into one single index?  
> If yes, that explains a lot. I previously thought I can only specify one  
> data source to pull from  
> for each Elasticsearch index...
> 
> Radu Gheorghe於 2012年10月24日星期三UTC+8下午8時25分03秒寫道：
> 
> > Hello Liang-Yu,
> > 
> > On Wed, Oct 24, 2012 at 6:38 AM, Liang-Yu Chou [fishl...@gmail.com](mailto:fishl...@gmail.com) wrote:
> > 
> > > Hello all, I'm trying to incorporate Elasticsearch with our existing  
> > > MongoDB  
> > > database.  
> > > Currently we have a mongo collection separated to three mongo shards.  
> > > Does that mean I have to use three Elasticsearch clusters for each of  
> > > them?
> > 
> > You shouldn't need 3 _clusters_. You might need more than one  
> > Elasticsearch server to handle the load, but that depends on a lot of  
> > factors, mainly about how your data, queries and hardware look like.
> > 
> > > Is there a simpler practice to just use a single Elasticsearch cluster  
> > > only?
> > 
> > The easiest way to index data from your MongoDB cluster to an  
> > Elasticsearch cluster is using the MongoDB river:  
> > [GitHub - richardwilly98/elasticsearch-river-mongodb: MongoDB River Plugin for ElasticSearch](https://github.com/richardwilly98/elasticsearch-river-mongodb)
> > 
> > There's a nice Wiki there as well, with instructions:  
> > [Home · richardwilly98/elasticsearch-river-mongodb Wiki · GitHub](https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki)
> > 
> > ## Best regards, Radu
> > 
> > [http://sematext.com/](http://sematext.com/) -- Elasticsearch -- Solr -- Lucene
> 
> --

--

---

<div class="post-metadata">

**Author:** ![yesu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yesu/32/48857_2.png) [@yesu](https://discuss.elastic.co/u/yesu)\
**Post date:** [June 2, 2016, 12:22pm UTC](https://discuss.elastic.co/t/per-mongodb-shard-per-elasticsearch-cluster/9454/5 "2016-06-02T12:22:38Z")

</div>

Hi All,

I have configured elasticsearch mongodb river on mongodb shard cluster to index data. Have 3 shareds and configured river on each shard(mean have 3 indexes in single ES cluster). Here i facing issue, when data migration happening among mongodb shards those changes not reflecting in elasticsearch.

Can anybody please help me.

Or one river configuration would on complete mongo shard cluster(on mongose)?

Thanks,  
Yesu

---

<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 5, 2017, 10:46pm UTC](https://discuss.elastic.co/t/per-mongodb-shard-per-elasticsearch-cluster/9454/6 "2017-07-05T22:46:54Z")

</div>


