# Mongodb river plugin

**URL:** <https://discuss.elastic.co/t/mongodb-river-plugin/10204>\
**Category:** Elasticsearch\
**Created:** [December 30, 2012, 10:58am UTC](https://discuss.elastic.co/t/mongodb-river-plugin/10204 "2012-12-30T10:58:25Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Janusz\_Dalecki](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@Janusz\_Dalecki](https://discuss.elastic.co/u/Janusz_Dalecki)\
**Post date:** [December 30, 2012, 10:58am UTC](https://discuss.elastic.co/t/mongodb-river-plugin/10204/1 "2012-12-30T10:58:25Z")

</div>

Hi,

I am trying to use mongodb river plugin – unfortunately without any success.

When I try to execute this command:

[http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)

{

```
"type": "mongodb", 

"mongodb": { 

    "db": "my_database", 

    "collection": "ProductProduct"

}, 

"index": {

    "name": "mongoindex", 

    "type": "ProductProduct" 

}

```

}

I am getting this exception:

Exception in thread "elasticsearch[Jazz][generic][T#4]"  
java.lang.NoSuchMethodError: org.elasticsear

ch.client.IndicesAdminClient.prepareCreate(Ljava/lang/String;)Lorg/elasticsearch/client/action/admin

/indices/create/CreateIndexRequestBuilder;

```
    at 

```

org.elasticsearch.river.mongodb.MongoDBRiver.start(MongoDBRiver.java:144)

```
    at 

```

org.elasticsearch.river.RiversService.createRiver(RiversService.java:146)

```
    at 

```

org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:270)

```
    at 

```

org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:264)

```
    at 

```

org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAc

I really don’t know why MongoDBRiver.start tries to resolve to the org.elasticsearch.client.action.admin.indices.create.  
CreateIndexRequestBuilder package instead oforg.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder  
.

Any ideas guys?

Regards,

Janusz

--

---

<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:** [December 30, 2012, 12:43pm UTC](https://discuss.elastic.co/t/mongodb-river-plugin/10204/2 "2012-12-30T12:43:06Z")

</div>

What is your es server version?

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 30 déc. 2012 à 11:58, JD [jdalecki@tycoint.com](mailto:jdalecki@tycoint.com) a écrit :

Hi,  
I am trying to use mongodb river plugin – unfortunately without any success.  
When I try to execute this command:  
[http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)  
{  
"type": "mongodb",  
"mongodb": {  
"db": "my\_database",  
"collection": "ProductProduct"  
},  
"index": {  
"name": "mongoindex",  
"type": "ProductProduct"  
}  
}  
I am getting this exception:

Exception in thread "elasticsearch[Jazz][generic][T#4]" java.lang.NoSuchMethodError: org.elasticsear  
ch.client.IndicesAdminClient.prepareCreate(Ljava/lang/String;)Lorg/elasticsearch/client/action/admin  
/indices/create/CreateIndexRequestBuilder;  
at org.elasticsearch.river.mongodb.MongoDBRiver.start(MongoDBRiver.java:144)  
at org.elasticsearch.river.RiversService.createRiver(RiversService.java:146)  
at org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:270)  
at org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:264)  
at org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAc

I really don’t know why MongoDBRiver.start tries to resolve to the org.elasticsearch.client.action.admin.indices.create. CreateIndexRequestBuilder package instead of org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder.  
Any ideas guys?  
Regards,

## Janusz

--

---

<div class="post-metadata">

**Author:** ![Janusz\_Dalecki](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@Janusz\_Dalecki](https://discuss.elastic.co/u/Janusz_Dalecki)\
**Post date:** [December 30, 2012, 8:10pm UTC](https://discuss.elastic.co/t/mongodb-river-plugin/10204/3 "2012-12-30T20:10:11Z")

</div>

Hi,  
Its elasticsearch 0.20.1.  
Which version should I use?  
Regards,  
Janusz

On Sunday, December 30, 2012 9:58:25 PM UTC+11, JD wrote:

> Hi,
> 
> I am trying to use mongodb river plugin – unfortunately without any  
> success.
> 
> When I try to execute this command:
> 
> [http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)
> 
> {
> 
> ```
> "type": "mongodb", 
> 
> "mongodb": { 
> 
> "db": "my_database", 
> 
> "collection": "ProductProduct"
> 
> }, 
> 
> "index": {
> 
> "name": "mongoindex", 
> 
> "type": "ProductProduct" 
> 
> }
> 
> ```
> 
> }
> 
> I am getting this exception:
> 
> Exception in thread "elasticsearch[Jazz][generic][T#4]"  
> java.lang.NoSuchMethodError: org.elasticsear
> 
> ch.client.IndicesAdminClient.prepareCreate(Ljava/lang/String;)Lorg/elasticsearch/client/action/admin
> 
> /indices/create/CreateIndexRequestBuilder;
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.river.mongodb.MongoDBRiver.start(MongoDBRiver.java:144)
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.river.RiversService.createRiver(RiversService.java:146)
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:270)
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:264)
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAc
> 
> I really don’t know why MongoDBRiver.start tries to resolve to the org.elasticsearch.client.action.admin.indices.create.  
> CreateIndexRequestBuilder package instead oforg.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder  
> .
> 
> Any ideas guys?
> 
> Regards,
> 
> Janusz

--

---

<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:** [December 30, 2012, 8:20pm UTC](https://discuss.elastic.co/t/mongodb-river-plugin/10204/4 "2012-12-30T20:20:50Z")

</div>

With mongo river 1.6.0?

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

Le 30 déc. 2012 à 21:10, JD [jdalecki@tycoint.com](mailto:jdalecki@tycoint.com) a écrit :

Hi,  
Its elasticsearch 0.20.1.  
Which version should I use?  
Regards,  
Janusz

On Sunday, December 30, 2012 9:58:25 PM UTC+11, JD wrote:

> Hi,  
> I am trying to use mongodb river plugin – unfortunately without any success.  
> When I try to execute this command:  
> [http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)  
> {  
> "type": "mongodb",  
> "mongodb": {  
> "db": "my\_database",  
> "collection": "ProductProduct"  
> },  
> "index": {  
> "name": "mongoindex",  
> "type": "ProductProduct"  
> }  
> }  
> I am getting this exception:
> 
> Exception in thread "elasticsearch[Jazz][generic][T#4]" java.lang.NoSuchMethodError: org.elasticsear  
> ch.client.IndicesAdminClient.prepareCreate(Ljava/lang/String;)Lorg/elasticsearch/client/action/admin  
> /indices/create/CreateIndexRequestBuilder;  
> at org.elasticsearch.river.mongodb.MongoDBRiver.start(MongoDBRiver.java:144)  
> at org.elasticsearch.river.RiversService.createRiver(RiversService.java:146)  
> at org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:270)  
> at org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:264)  
> at org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAc
> 
> I really don’t know why MongoDBRiver.start tries to resolve to the org.elasticsearch.client.action.admin.indices.create. CreateIndexRequestBuilder package instead of org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder.  
> Any ideas guys?  
> Regards,
> 
> Janusz

--

--

---

<div class="post-metadata">

**Author:** ![Janusz\_Dalecki](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@Janusz\_Dalecki](https://discuss.elastic.co/u/Janusz_Dalecki)\
**Post date:** [December 30, 2012, 8:48pm UTC](https://discuss.elastic.co/t/mongodb-river-plugin/10204/5 "2012-12-30T20:48:43Z")

</div>

Sorry David for stupid question.  
I don't seem to be able to find the version 1.6.0 of mongo river.  
Would you know how to get it?  
Regards,  
Janusz

On Sunday, December 30, 2012 9:58:25 PM UTC+11, JD wrote:

> Hi,
> 
> I am trying to use mongodb river plugin – unfortunately without any  
> success.
> 
> When I try to execute this command:
> 
> [http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)
> 
> {
> 
> ```
> "type": "mongodb", 
> 
> "mongodb": { 
> 
> "db": "my_database", 
> 
> "collection": "ProductProduct"
> 
> }, 
> 
> "index": {
> 
> "name": "mongoindex", 
> 
> "type": "ProductProduct" 
> 
> }
> 
> ```
> 
> }
> 
> I am getting this exception:
> 
> Exception in thread "elasticsearch[Jazz][generic][T#4]"  
> java.lang.NoSuchMethodError: org.elasticsear
> 
> ch.client.IndicesAdminClient.prepareCreate(Ljava/lang/String;)Lorg/elasticsearch/client/action/admin
> 
> /indices/create/CreateIndexRequestBuilder;
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.river.mongodb.MongoDBRiver.start(MongoDBRiver.java:144)
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.river.RiversService.createRiver(RiversService.java:146)
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:270)
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:264)
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAc
> 
> I really don’t know why MongoDBRiver.start tries to resolve to the org.elasticsearch.client.action.admin.indices.create.  
> CreateIndexRequestBuilder package instead oforg.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder  
> .
> 
> Any ideas guys?
> 
> Regards,
> 
> Janusz

--

---

<div class="post-metadata">

**Author:** ![Janusz\_Dalecki](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@Janusz\_Dalecki](https://discuss.elastic.co/u/Janusz_Dalecki)\
**Post date:** [December 30, 2012, 9:21pm UTC](https://discuss.elastic.co/t/mongodb-river-plugin/10204/6 "2012-12-30T21:21:50Z")

</div>

Hi,  
I have also tried to build 1.6.0 from repository using maven - but it gives  
me this error:  
[ERROR] Failed to execute goal on project elasticsearch-river-mongodb:  
Could not resolve dependencies for project  
org.elasticsearch:elasticsearch-river-mongodb:jar:1.6.0: Could not find  
artifact de.flapdoodle.embed:de.flapdoodle.embed.mongo:jar:1.28-SNAPSHOT in  
sonatype-releases ([http://oss.sonatype.org/content/repositories/releases](http://oss.sonatype.org/content/repositories/releases))  
-\> [Help 1]

Any help appreciated.  
Regards,  
Janusz

On Sunday, December 30, 2012 9:58:25 PM UTC+11, JD wrote:

> Hi,
> 
> I am trying to use mongodb river plugin – unfortunately without any  
> success.
> 
> When I try to execute this command:
> 
> [http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)
> 
> {
> 
> ```
> "type": "mongodb", 
> 
> "mongodb": { 
> 
> "db": "my_database", 
> 
> "collection": "ProductProduct"
> 
> }, 
> 
> "index": {
> 
> "name": "mongoindex", 
> 
> "type": "ProductProduct" 
> 
> }
> 
> ```
> 
> }
> 
> I am getting this exception:
> 
> Exception in thread "elasticsearch[Jazz][generic][T#4]"  
> java.lang.NoSuchMethodError: org.elasticsear
> 
> ch.client.IndicesAdminClient.prepareCreate(Ljava/lang/String;)Lorg/elasticsearch/client/action/admin
> 
> /indices/create/CreateIndexRequestBuilder;
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.river.mongodb.MongoDBRiver.start(MongoDBRiver.java:144)
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.river.RiversService.createRiver(RiversService.java:146)
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:270)
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:264)
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAc
> 
> I really don’t know why MongoDBRiver.start tries to resolve to the org.elasticsearch.client.action.admin.indices.create.  
> CreateIndexRequestBuilder package instead oforg.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder  
> .
> 
> Any ideas guys?
> 
> Regards,
> 
> Janusz

--

---

<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:** [December 30, 2012, 9:54pm UTC](https://discuss.elastic.co/t/mongodb-river-plugin/10204/7 "2012-12-30T21:54:25Z")

</div>

That strange. It's not a best pratice to release a version containing SNAPSHOT  
dependencies.  
I suggest that to raise an issue to track it on

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

Can't you install it with  
bin\plugin -install richardwilly98/elasticsearch-river-mongodb/1.6.0

If it does not work, try to download it from  
[https://github.com/downloads/richardwilly98/elasticsearch-river-mongodb/elasticsearch-river-mongodb-1.6.0.zip](https://github.com/downloads/richardwilly98/elasticsearch-river-mongodb/elasticsearch-river-mongodb-1.6.0.zip)

HTH  
David

Le 30 décembre 2012 à 22:21, JD [jdalecki@tycoint.com](mailto:jdalecki@tycoint.com) a écrit :

> Hi,  
> I have also tried to build 1.6.0 from repository using maven - but it gives  
> me this error:  
> [ERROR] Failed to execute goal on project elasticsearch-river-mongodb: Could  
> not resolve dependencies for project  
> org.elasticsearch:elasticsearch-river-mongodb:jar:1.6.0: Could not find  
> artifact de.flapdoodle.embed:de.flapdoodle.embed.mongo:jar:1.28-SNAPSHOT in  
> sonatype-releases ([http://oss.sonatype.org/content/repositories/releases](http://oss.sonatype.org/content/repositories/releases)) -\>  
> [Help 1]
> 
> Any help appreciated.  
> Regards,  
> Janusz
> 
> On Sunday, December 30, 2012 9:58:25 PM UTC+11, JD wrote:
> 
> > > 
> > 
> > Hi,
> > 
> > I am trying to use mongodb river plugin – unfortunately without any  
> > success.
> > 
> > When I try to execute this command:
> > 
> > [http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)  
> > [http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)
> > 
> > {
> > 
> > ```
> > "type": "mongodb",
> > 
> > "mongodb": {
> > 
> > "db": "my_database",
> > 
> > "collection": "ProductProduct"
> > 
> > },
> > 
> > "index": {
> > 
> > "name": "mongoindex",
> > 
> > "type": "ProductProduct"
> > 
> > }
> > 
> > ```
> > 
> > }
> > 
> > I am getting this exception:
> > 
> > Exception in thread "elasticsearch[Jazz][generic][T#4]"  
> > java.lang.NoSuchMethodError: org.elasticsear
> > 
> > ch.client.IndicesAdminClient.prepareCreate(Ljava/lang/String;)Lorg/elasticsearch/client/action/admin
> > 
> > /indices/create/CreateIndexRequestBuilder;
> > 
> > ```
> > at
> > 
> > ```
> > 
> > org.elasticsearch.river.mongodb.MongoDBRiver.start(MongoDBRiver.java:144)
> > 
> > ```
> > at
> > 
> > ```
> > 
> > org.elasticsearch.river.RiversService.createRiver(RiversService.java:146)
> > 
> > ```
> > at
> > 
> > ```
> > 
> > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:270)
> > 
> > ```
> > at
> > 
> > ```
> > 
> > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:264)
> > 
> > ```
> > at
> > 
> > ```
> > 
> > org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAc
> > 
> > I really don’t know why MongoDBRiver.start tries to resolve to the  
> > org.elasticsearch.client.action.admin.indices.create.  
> > CreateIndexRequestBuilder package instead of  
> > org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder.
> > 
> > Any ideas guys?
> > 
> > Regards,
> > 
> > Janusz
> > 
> > >
> 
> --
> 
> [http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)

[http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)

--  
David Pilato  
[http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

---

<div class="post-metadata">

**Author:** ![Janusz\_Dalecki](https://avatars.discourse-cdn.com/v4/letter/j/73ab20/32.png) [@Janusz\_Dalecki](https://discuss.elastic.co/u/Janusz_Dalecki)\
**Post date:** [December 31, 2012, 10:40am UTC](https://discuss.elastic.co/t/mongodb-river-plugin/10204/8 "2012-12-31T10:40:28Z")

</div>

Hi,

Thanks for the tips. After following your instructions I don’t get any more  
exceptions – however now I get this error below:

[2012-12-31 16:14:12,281][INFO][river.mongodb] [Magus]  
[mongodb][mongodb] starting mongodb server

(s): host [localhost], port [27017]

[2012-12-31 16:14:12,282][INFO][river.mongodb] [Magus]  
[mongodb][mongodb] starting mongodb stream: options:  
secondaryreadpreference [false], gridfs [false], filter [testmongo], db  
[mongoindex], indexing to [person]/[{}]

[2012-12-31 16:14:13,006][ERROR][river.mongodb] [Magus]  
[mongodb][mongodb] _Cannot find oplog.rs collection._ Please use check this  
link: [http://goo.gl/2x5IW](http://goo.gl/2x5IW)

When I follow the instructions from mongodb plugin site to create the index  
and the document - like the ones below:

curl -XPUT '[http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)' -d '{

```
"type": "mongodb", 

"mongodb": { 

    "db": "testmongo", 

    "collection": "person"

}, 

"index": {

    "name": "mongoindex", 

    "type": "person" 

}

```

}'

In the mongodb command console I execute:

use testmongo

var p = {firstName: "John", lastName: "Doe"}

db.person.save(p)

Then when I execute the instruction below:

curl -XGET '[http://localhost:9200/mongoindex/\_search?q=firstName:John](http://localhost:9200/mongoindex/_search?q=firstName:John)'

… I always get an empty result, like below (hits.total = 0):

{

```
"took": 25,

"timed_out": false,

"_shards": {

    "total": 5,

    "successful": 5,

    "failed": 0

},

"hits": {

    "total": 0,

    "max_score": null,

    "hits": []

}

```

}

I suspect the reason for that is the error that comes when I start  
elasticsearch (with mongodb river plugin):

Cannot find oplog.rs collection

I have no idea what the problem is. I have found some answers talking about  
some “replica set” set on MongoDB, but I have standalone MongoDB – just one  
node (localhost: 27017).

I am using MongoDb version: 2.2.2-rc1, elasticsearch-0.20.1 and Mongo River  
Plugin 1.6.0

Regards,

Janusz

On Sunday, December 30, 2012 9:58:25 PM UTC+11, JD wrote:

> Hi,
> 
> I am trying to use mongodb river plugin – unfortunately without any  
> success.
> 
> When I try to execute this command:
> 
> [http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)
> 
> {
> 
> ```
> "type": "mongodb", 
> 
> "mongodb": { 
> 
> "db": "my_database", 
> 
> "collection": "ProductProduct"
> 
> }, 
> 
> "index": {
> 
> "name": "mongoindex", 
> 
> "type": "ProductProduct" 
> 
> }
> 
> ```
> 
> }
> 
> I am getting this exception:
> 
> Exception in thread "elasticsearch[Jazz][generic][T#4]"  
> java.lang.NoSuchMethodError: org.elasticsear
> 
> ch.client.IndicesAdminClient.prepareCreate(Ljava/lang/String;)Lorg/elasticsearch/client/action/admin
> 
> /indices/create/CreateIndexRequestBuilder;
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.river.mongodb.MongoDBRiver.start(MongoDBRiver.java:144)
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.river.RiversService.createRiver(RiversService.java:146)
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:270)
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:264)
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAc
> 
> I really don’t know why MongoDBRiver.start tries to resolve to the org.elasticsearch.client.action.admin.indices.create.  
> CreateIndexRequestBuilder package instead oforg.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder  
> .
> 
> Any ideas guys?
> 
> Regards,
> 
> Janusz

--

---

<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:** [December 31, 2012, 10:52am UTC](https://discuss.elastic.co/t/mongodb-river-plugin/10204/9 "2012-12-31T10:52:18Z")

</div>

You have to fix this error before searching in ES. The river is not working.  
Unfortunately, I don't use MongoDB myself so I can't help more here.

My last advice can be "follow instructions here:  
[Home · richardwilly98/elasticsearch-river-mongodb Wiki · GitHub](https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki)  
[https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki](https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki) "

> The current implementation monitors oplog collection from the local database.  
> Make sure to enable replica set 0  
> [https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki#wiki-fn0](https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki#wiki-fn0)  
> . It does not support master / slave replication. Monitoring is done using  
> tailable cursor 1  
> [https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki#wiki-fn1](https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki#wiki-fn1)  
> . All operations are supported: insert, update, delete.

David.

Le 31 décembre 2012 à 11:40, JD [jdalecki@tycoint.com](mailto:jdalecki@tycoint.com) a écrit :

> Hi,
> 
> Thanks for the tips. After following your instructions I don’t get any more  
> exceptions – however now I get this error below:  
> [2012-12-31 16:14:12,281][INFO][river.mongodb] [Magus]  
> [mongodb][mongodb] starting mongodb server  
> (s): host [localhost], port [27017]  
> [2012-12-31 16:14:12,282][INFO][river.mongodb] [Magus]  
> [mongodb][mongodb] starting mongodb stream: options: secondaryreadpreference  
> [false], gridfs [false], filter [testmongo], db [mongoindex], indexing to  
> [person]/[{}]  
> [2012-12-31 16:14:13,006][ERROR][river.mongodb] [Magus]  
> [mongodb][mongodb] Cannot find oplog.rs collection. Please use check this  
> link: [http://goo.gl/2x5IW](http://goo.gl/2x5IW)
> 
> When I follow the instructions from mongodb plugin site to create the index  
> and the document - like the ones below:
> 
> ```
> curl -XPUT 'http://localhost:9200/_river/mongodb/_meta' -d '{
> "type": "mongodb",
> "mongodb": {
> "db": "testmongo",
> "collection": "person"
> },
> "index": {
> "name": "mongoindex",
> "type": "person"
> }
> }'
> 
> ```
> 
> In the mongodb command console I execute:  
> use testmongo  
> var p = {firstName: "John", lastName: "Doe"}  
> db.person.save(p)
> 
> Then when I execute the instruction below:  
> curl -XGET '[http://localhost:9200/mongoindex/\_search?q=firstName:John](http://localhost:9200/mongoindex/_search?q=firstName:John)'
> 
> … I always get an empty result, like below (hits.total = 0):
> 
> {
> 
> ```
> "took": 25,
> 
> "timed_out": false,
> 
> "_shards": {
> 
> "total": 5,
> 
> "successful": 5,
> 
> "failed": 0
> 
> },
> 
> "hits": {
> 
> "total": 0,
> 
> "max_score": null,
> 
> "hits": []
> 
> }
> 
> ```
> 
> }
> 
> I suspect the reason for that is the error that comes when I start  
> elasticsearch (with mongodb river plugin):
> 
> Cannot find oplog.rs collection
> 
> I have no idea what the problem is. I have found some answers talking about  
> some “replica set” set on MongoDB, but I have standalone MongoDB – just one  
> node (localhost: 27017).
> 
> I am using MongoDb version: 2.2.2-rc1, elasticsearch-0.20.1 and Mongo River  
> Plugin 1.6.0
> 
> Regards,
> 
> Janusz
> 
> On Sunday, December 30, 2012 9:58:25 PM UTC+11, JD wrote:
> 
> > > 
> > 
> > Hi,
> > 
> > I am trying to use mongodb river plugin – unfortunately without any  
> > success.
> > 
> > When I try to execute this command:
> > 
> > [http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)  
> > [http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)
> > 
> > {
> > 
> > ```
> > "type": "mongodb",
> > 
> > "mongodb": {
> > 
> > "db": "my_database",
> > 
> > "collection": "ProductProduct"
> > 
> > },
> > 
> > "index": {
> > 
> > "name": "mongoindex",
> > 
> > "type": "ProductProduct"
> > 
> > }
> > 
> > ```
> > 
> > }
> > 
> > I am getting this exception:
> > 
> > Exception in thread "elasticsearch[Jazz][generic][T#4]"  
> > java.lang.NoSuchMethodError: org.elasticsear
> > 
> > ch.client.IndicesAdminClient.prepareCreate(Ljava/lang/String;)Lorg/elasticsearch/client/action/admin
> > 
> > /indices/create/CreateIndexRequestBuilder;
> > 
> > ```
> > at
> > 
> > ```
> > 
> > org.elasticsearch.river.mongodb.MongoDBRiver.start(MongoDBRiver.java:144)
> > 
> > ```
> > at
> > 
> > ```
> > 
> > org.elasticsearch.river.RiversService.createRiver(RiversService.java:146)
> > 
> > ```
> > at
> > 
> > ```
> > 
> > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:270)
> > 
> > ```
> > at
> > 
> > ```
> > 
> > org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:264)
> > 
> > ```
> > at
> > 
> > ```
> > 
> > org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAc
> > 
> > I really don’t know why MongoDBRiver.start tries to resolve to the  
> > org.elasticsearch.client.action.admin.indices.create.  
> > CreateIndexRequestBuilder package instead of  
> > org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder.
> > 
> > Any ideas guys?
> > 
> > Regards,
> > 
> > Janusz
> > 
> > >
> 
> --
> 
> [http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)

[http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)

--  
David Pilato  
[http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
[http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--

---

<div class="post-metadata">

**Author:** ![ChrisB](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chrisb/32/2430_2.png) [@ChrisB](https://discuss.elastic.co/u/ChrisB)\
**Post date:** [March 19, 2013, 3:55pm UTC](https://discuss.elastic.co/t/mongodb-river-plugin/10204/10 "2013-03-19T15:55:56Z")

</div>

I know this post is a few months old, but I ran into this problem as well  
and did find a solution:  
[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/).

In case that link goes down, I'll repro the relevant parts here. You need  
to set up a replica set, regardless of whether you're running a single  
MongoDB node or not: configure your mongodb instance to have a replica set  
name and oplog size by adding

replSet=rs0  
oplogSize=100

to the config file, restart mongod, open the mongo shell, and run  
"rs.initiate()" to initiate your single node replica set. The river  
commands/indexing should work after that.

~Chris

On Monday, December 31, 2012 2:52:18 AM UTC-8, David Pilato wrote:

> You have to fix this error before searching in ES. The river is not  
> working.  
> Unfortunately, I don't use MongoDB myself so I can't help more here.
> 
> My last advice can be "follow instructions here:  
> [Home · richardwilly98/elasticsearch-river-mongodb Wiki · GitHub](https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki)"
> 
> > The current implementation monitors oplog collection from the local  
> > database. Make sure to enable replica set 0[https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki#wiki-fn0](https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki#wiki-fn0).  
> > It does not support master / slave replication. Monitoring is done using  
> > tailable cursor 1[https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki#wiki-fn1](https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki#wiki-fn1).  
> > All operations are supported: insert, update, delete.
> 
> David.
> 
> Le 31 décembre 2012 à 11:40, JD \<[jdal...@tycoint.com](mailto:jdal...@tycoint.com) \<javascript:\>\> a  
> écrit :
> 
> Hi,
> 
> Thanks for the tips. After following your instructions I don’t get any  
> more exceptions – however now I get this error below:
> 
> [2012-12-31 16:14:12,281][INFO][river.mongodb] [Magus]  
> [mongodb][mongodb] starting mongodb server
> 
> (s): host [localhost], port [27017]
> 
> [2012-12-31 16:14:12,282][INFO][river.mongodb] [Magus]  
> [mongodb][mongodb] starting mongodb stream: options:  
> secondaryreadpreference [false], gridfs [false], filter [testmongo], db  
> [mongoindex], indexing to [person]/[{}]
> 
> [2012-12-31 16:14:13,006][ERROR][river.mongodb] [Magus]  
> [mongodb][mongodb] _Cannot find oplog.rs collection._ Please use check  
> this link: [http://goo.gl/2x5IW](http://goo.gl/2x5IW)
> 
> When I follow the instructions from mongodb plugin site to create the  
> index and the document - like the ones below:
> 
> curl -XPUT '[http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)' -d '{
> 
> ```
> "type": "mongodb", 
> 
> "mongodb": { 
> 
> "db": "testmongo", 
> 
> "collection": "person"
> 
> }, 
> 
> "index": {
> 
> "name": "mongoindex", 
> 
> "type": "person" 
> 
> }
> 
> ```
> 
> }'
> 
> In the mongodb command console I execute:
> 
> use testmongo
> 
> var p = {firstName: "John", lastName: "Doe"}
> 
> db.person.save(p)
> 
> Then when I execute the instruction below:
> 
> curl -XGET '[http://localhost:9200/mongoindex/\_search?q=firstName:John](http://localhost:9200/mongoindex/_search?q=firstName:John)'
> 
> … I always get an empty result, like below (hits.total = 0):
> 
> {
> 
> ```
> "took": 25,
> 
> "timed_out": false,
> 
> "_shards": {
> 
> "total": 5,
> 
> "successful": 5,
> 
> "failed": 0
> 
> },
> 
> "hits": {
> 
> "total": 0,
> 
> "max_score": null,
> 
> "hits": []
> 
> }
> 
> ```
> 
> }
> 
> I suspect the reason for that is the error that comes when I start  
> elasticsearch (with mongodb river plugin):
> 
> Cannot find oplog.rs collection
> 
> I have no idea what the problem is. I have found some answers talking  
> about some “replica set” set on MongoDB, but I have standalone MongoDB –  
> just one node (localhost: 27017).
> 
> I am using MongoDb version: 2.2.2-rc1, elasticsearch-0.20.1 and Mongo  
> River Plugin 1.6.0
> 
> Regards,
> 
> Janusz
> 
> On Sunday, December 30, 2012 9:58:25 PM UTC+11, JD wrote:
> 
> Hi,
> 
> I am trying to use mongodb river plugin – unfortunately without any  
> success.
> 
> When I try to execute this command:
> 
> [http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)
> 
> {
> 
> ```
> "type": "mongodb",
> 
> "mongodb": {
> 
> "db": "my_database",
> 
> "collection": "ProductProduct"
> 
> },
> 
> "index": {
> 
> "name": "mongoindex",
> 
> "type": "ProductProduct"
> 
> }
> 
> ```
> 
> }
> 
> I am getting this exception:
> 
> Exception in thread "elasticsearch[Jazz][generic][T#4]"  
> java.lang.NoSuchMethodError: org.elasticsear
> 
> ch.client.IndicesAdminClient.prepareCreate(Ljava/lang/String;)Lorg/elasticsearch/client/action/admin
> 
> /indices/create/CreateIndexRequestBuilder;
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.river.mongodb.MongoDBRiver.start(MongoDBRiver.java:144)
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.river.RiversService.createRiver(RiversService.java:146)
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:270)
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.river.RiversService$ApplyRivers$2.onResponse(RiversService.java:264)
> 
> ```
> at 
> 
> ```
> 
> org.elasticsearch.action.support.TransportAction$ThreadedActionListener$1.run(TransportAc
> 
> I really don’t know why MongoDBRiver.start tries to resolve to the org.elasticsearch.client.action.admin.indices.create.  
> CreateIndexRequestBuilder package instead oforg.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder  
> .
> 
> Any ideas guys?
> 
> Regards,
> 
> Janusz
> 
> --
> 
> [http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)
> 
> [http://localhost:9200/\_river/mongodb/\_meta](http://localhost:9200/_river/mongodb/_meta)
> 
> --  
> David Pilato  
> [http://www.scrutmydocs.org/](http://www.scrutmydocs.org/)  
> [http://dev.david.pilato.fr/](http://dev.david.pilato.fr/)  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Way\_Cool](https://avatars.discourse-cdn.com/v4/letter/w/f4b2a3/32.png) [@Way\_Cool](https://discuss.elastic.co/u/Way_Cool)\
**Post date:** [March 28, 2013, 11:40pm UTC](https://discuss.elastic.co/t/mongodb-river-plugin/10204/11 "2013-03-28T23:40:59Z")

</div>

Still not working. No errors at all though. Just did not return anything.

---

<div class="post-metadata">

**Author:** ![saiprasad\_mishra](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@saiprasad\_mishra](https://discuss.elastic.co/u/saiprasad_mishra)\
**Post date:** [June 4, 2013, 10:10pm UTC](https://discuss.elastic.co/t/mongodb-river-plugin/10204/12 "2013-06-04T22:10:35Z")

</div>

The following versions combinations worked for me .. all usecases like insert/update/delete a mongo document and flowing to elastic search

Configure a replicaset like below in mongo 2.2.1 mac osx version

mongod --port 27017 --dbpath /data/db0 --replSet rs0 --smallfiles --oplogSize 128  
mongod --port 27018 --dbpath /data/db1 --replSet rs0 --smallfiles --oplogSize 128  
mongod --port 27019 --dbpath /data/db2 --replSet rs0 --smallfiles --oplogSize 128

Intall the following river plugin and dependencies

ES\_HOME/bin/plugin -install mobz/elasticsearch-head - optional in case you want to see whats happening in elastic search visually and query

ES\_HOME/bin/plugin -install elasticsearch/elasticsearch-mapper-attachments/1.7.0

%ES\_HOME%\bin\plugin.bat -url [https://oss.sonatype.org/content/repositories/releases/com/github/richardwilly98/elasticsearch/elasticsearch-river-mongodb/1.6.8/elasticsearch-river-mongodb-1.6.8.zip](https://oss.sonatype.org/content/repositories/releases/com/github/richardwilly98/elasticsearch/elasticsearch-river-mongodb/1.6.8/elasticsearch-river-mongodb-1.6.8.zip) -install river-mongodb

The index was created by pointing to the primary

curl -XPUT "localhost:9200/\_river/mydb/\_meta" -d '  
{  
"type": "mongodb",  
"mongodb": {  
"servers": [  
{ "host": "xxx", "port": 27017 }  
],  
"db": "mydb",  
"collection": "sampleDoc"  
},  
"index": {  
"name": "mongoindex10",  
"type": "sampleDoc"  
}  
}'

---

<div class="post-metadata">

**Author:** ![saiprasad\_mishra](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@saiprasad\_mishra](https://discuss.elastic.co/u/saiprasad_mishra)\
**Post date:** [June 4, 2013, 10:14pm UTC](https://discuss.elastic.co/t/mongodb-river-plugin/10204/13 "2013-06-04T22:14:47Z")

</div>

The following versions combinations worked for me .. all usecases like  
insert/update/delete a mongo document and flowing to Elasticsearch

Configure a replicaset like below in mongo 2.2.1 mac osx version

mongod --port 27017 --dbpath /data/db0 --replSet rs0 --smallfiles  
--oplogSize 128  
mongod --port 27018 --dbpath /data/db1 --replSet rs0 --smallfiles  
--oplogSize 128  
mongod --port 27019 --dbpath /data/db2 --replSet rs0 --smallfiles  
--oplogSize 128

Intall the following river plugin and dependencies

ES\_HOME/bin/plugin -install mobz/elasticsearch-head - optional in case you  
want to see whats happening in Elasticsearch visually and query

ES\_HOME/bin/plugin -install  
elasticsearch/elasticsearch-mapper-attachments/1.7.0

%ES\_HOME%\bin\plugin.bat -url  
[https://oss.sonatype.org/content/repositories/releases/com/github/richardwilly98/elasticsearch/elasticsearch-](https://oss.sonatype.org/content/repositories/releases/com/github/richardwilly98/elasticsearch/elasticsearch-)  
river-mongodb/1.6.8/elasticsearch-river-mongodb-1.6.8.zip -install river-  
mongodb

The index was created by pointing to the primary

curl -XPUT "localhost:9200/\_river/mydb/\_meta" -d '  
{  
"type": "mongodb",  
"mongodb": {  
"servers": [  
{ "host": "xxx", "port": 27017 }  
],  
"db": "mydb",  
"collection": "sampleDoc"  
},  
"index": {  
"name": "mongoindex10",  
"type": "sampleDoc"  
}  
}'

On Thursday, March 28, 2013 4:41:00 PM UTC-7, Way Cool wrote:

> Still not working. No errors at all though. Just did not return anything.
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/mongodb-river-plugin-tp4027551p4032585.html](http://elasticsearch-users.115913.n3.nabble.com/mongodb-river-plugin-tp4027551p4032585.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:33am UTC](https://discuss.elastic.co/t/mongodb-river-plugin/10204/14 "2017-07-06T02:33:00Z")

</div>


