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
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"
The current implementation monitors oplog collection from the local
database. Make sure to enable replica set 0https://github.com/richardwilly98/elasticsearch-river-mongodb/wiki#wiki-fn0.
It does not support master / slave replication. Monitoring is done using
tailable cursor 1https://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 <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
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'
… 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
{
"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
--
David Pilato
http://www.scrutmydocs.org/
http://dev.david.pilato.fr/
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs