> --
> You received this message because you are subscribed to the Google Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.
>
>
Those messages doesn't mean its not finding the master, just that its
found a down node
As for failover time, its the same issue. Takes longer to detect
network issues that hard issues.
No, it uses the underlying Mongo instance, hence the Datastore
construction below.
> ds = morphia.createDatastore( m,
> mProps.getProperty("mongoDBDBName") );
>
> Where ds Morphia Datastore object and m is Mongo instance.
>
> In my design I have two asynchronous threads running. One thread which
> is waiting on Blocking queue to save Object which is annotated with
> Morphia annotations and another thread directly use BasicDBObject for
> persistence. This BasicDBObject is effectively able to save after
> Master failover where Morphia annotated is not able to save even after
> failover.
Are you checking for write errors? By default the datastore will make
all writes "Safe" so that exceptions can be raised. This is not the
default for the driver writes.
> Should I create new datastore object after Master failover or Morphia
> should take care of it ?
No, unless you are creating a new Mongo instance.
I believe the 2.3 driver does a better job of it though.
Nov 4, 2010 8:58:38 PM com.mongodb.ReplicaSetStatus$Node update
WARNING: node down: ip-10-166-59-166:20000 java.net.SocketException: Connection
reset
Nov 4, 2010 8:58:38 PM com.mongodb.DBTCPConnector$MyPort error
SEVERE: MyPort.error called
com.mongodb.MongoInternalException: DBPort.findOne failed
at com.mongodb.DBPort.findOne(DBPort.java:129)
at com.mongodb.DBPort.runCommand(DBPort.java:135)
at com.mongodb.DBTCPConnector._checkWriteError(DBTCPConnector.java:121)
at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:157)
at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:141)
at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:241)
at com.mongodb.DBApiLayer$MyCollection.insert(DBApiLayer.java:197)
at com.leadpoint.db.DbInsertListWorker.run(DbInsertListWorker.java:52)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.EOFException
at org.bson.io.Bits.readFully(Bits.java:37)
at org.bson.io.Bits.readFully(Bits.java:28)
at com.mongodb.Response.<init>(Response.java:35)
at com.mongodb.DBPort.go(DBPort.java:101)
at com.mongodb.DBPort.go(DBPort.java:66)
at com.mongodb.DBPort.findOne(DBPort.java:121)
... 10 more
DbInsertListWorker: exception com.mongodb.MongoInternalException: DBPort.findOne
failed
...
WARNING: node down: ip-10-166-59-166:20000 java.io.IOException: couldn't connect
to [ip-10-166-59-166/10.166.59.166:20000] bc:java.net.ConnectException:
Connection refused
Code:
try {
if (mongo != null) {
DB db = mongo.getDB(dbName);
if (db != null) {
db.requestStart();
DBCollection collection = db
.getCollection(collectionName);
if (collection != null) {
db.resetError();
collection.insert(list.toArray(new DBObject[list
.size()]), WriteConcern.REPLICAS_SAFE);
DBObject dbObject = db.getPreviousError();
if (dbObject != null && dbObject.get("err") != null)
{
System.out
.println("Info DbInsertListWorker
preverror:"
+ dbObject.toString());
}
dbObject = db
.getLastError(WriteConcern.REPLICAS_SAFE);
if (dbObject != null && dbObject.get("err") != null)
{
System.out
.println("Info DbInsertListWorker
lasterror:"
+ dbObject.toString());
}
} else {
System.out
.println("Info DbInsertListWorker: empty
collection");
}
db.requestDone();
} else {
System.out.println("Info DbInsertListWorker: empty db");
}
} else {
System.out.println("Info DbInsertListWorker: empty mongo");
}
} catch (Exception ex) {
System.out.println("DbInsertListWorker: exception " + ex);
ex.printStackTrace();
mongo.debugString() showed:
DBTCPConnector: replica set : [ip-10-166-59-166:20000,
ip-10-166-57-74:20000]
mongo.getConnectPoint() showed:
ip-10-166-59-166:20000