Update: no, failover does not work correctly, even if master server is up, but being secondary (rs.stepDown()):
2013-02-25 08:20:04,756 ERROR [de.caluga.morphium.messaging.Messaging] (Thread-12) Unhandled exception not master
com.mongodb.MongoException: not master
at com.mongodb.CommandResult.getException(CommandResult.java:100)
at com.mongodb.CommandResult.throwOnError(CommandResult.java:134)
at com.mongodb.DBTCPConnector._checkWriteError(DBTCPConnector.java:142)
at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:183)
at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:155)
at com.mongodb.DBApiLayer$MyCollection.remove(DBApiLayer.java:289)
at com.mongodb.DBCollection.remove(DBCollection.java:250)
at de.caluga.morphium.WriterImpl.delete(WriterImpl.java:421)
at de.caluga.morphium.Morphium.delete(Morphium.java:1816)
at de.caluga.morphium.messaging.Messaging.run(Messaging.java:77)
2013-02-25 08:20:07,280 ERROR [de.caluga.morphium.messaging.Messaging] (Thread-12) Unhandled exception not master
com.mongodb.MongoException: not master
at com.mongodb.CommandResult.getException(CommandResult.java:100)
at com.mongodb.CommandResult.throwOnError(CommandResult.java:134)
at com.mongodb.DBTCPConnector._checkWriteError(DBTCPConnector.java:142)
at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:183)
at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:155)
at com.mongodb.DBApiLayer$MyCollection.remove(DBApiLayer.java:289)
at com.mongodb.DBCollection.remove(DBCollection.java:250)
at de.caluga.morphium.WriterImpl.delete(WriterImpl.java:421)
at de.caluga.morphium.Morphium.delete(Morphium.java:1816)
at de.caluga.morphium.messaging.Messaging.run(Messaging.java:77)
2013-02-25 08:20:09,812 ERROR [de.caluga.morphium.messaging.Messaging] (Thread-12) Unhandled exception not master
com.mongodb.MongoException: not master
at com.mongodb.CommandResult.getException(CommandResult.java:100)
at com.mongodb.CommandResult.throwOnError(CommandResult.java:134)
at com.mongodb.DBTCPConnector._checkWriteError(DBTCPConnector.java:142)
at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:183)
at com.mongodb.DBTCPConnector.say(DBTCPConnector.java:155)
at com.mongodb.DBApiLayer$MyCollection.remove(DBApiLayer.java:289)
at com.mongodb.DBCollection.remove(DBCollection.java:250)
at de.caluga.morphium.WriterImpl.delete(WriterImpl.java:421)
at de.caluga.morphium.Morphium.delete(Morphium.java:1816)
at de.caluga.morphium.messaging.Messaging.run(Messaging.java:77)
One word about our setup:
2 Nodes (Master + Secondary) + 1 Arbiter.
Why is the mongo driver always trying to talk to master?
We needed to set the ReadPreference to Primary as there were problems with the writing to all slaves, as I already posted here
any Idea what this could be?