Hi Mahendra,
With a two node member replica set (one primary and one secondary), there is no automatic failover if the primary goes down. The way automatic failover works in MongoDB is that a replica set needs a qualified majority to successfully elect a new primary. Alternatively, introduce an arbiter into the replica set. Arbiters do not hold data, their purpose is to participate in elections in order to break ties in the election process. If a replica set has an even number of members, recommend to add an arbiter. The minimum recommended replica set deployment for production system is a three member replica set, a primary and two secondaries. These sets provide redundancy and fault tolerance.
For more information see:
Replica Set Deployment Architectures
The primary is the only member in the replica set that receives write operations from client applications.
The secondary node does not accept write operations from clients, but only accepts replication writes from the primary. Clients can read data from secondary members. See Read Preference for more information on how clients direct read operations to replica sets.
You can set the readPreference in the connection string for the clients to read from the secondary (instead of the primary). For example:
mongodb.url=mongodb://host.example.com/?readPreference=secondary
In your case, as the primary is down and the secondary has not become primary, it is not possible to continue the client application writes to a secondary member (which is in process of election and has not become primary) in the replica set. This is confirmed by the errors seen from the ycsb command output:
com: mongodb.MongoNotPrimaryException: The server is not the primary and did not execute the operation.
Regards,
Lian