You received the error message because both nodes (the node you are
connected to and the one being added) have different replica set configs.
It is likely that rs.initiate() was executed on both of the nodes.
The rs.initiate() command generates a new replica set configuration and
should only be run once per replica set on the initial primary node.
Once the initial replica configuration has been created, additional nodes
can be added using rs.add() or rs.reconfig(). See deploy replica set
<http://docs.mongodb.org/master/tutorial/deploy-replica-set/> for more
In order to fix your replica setup, choose one of the nodex that is
intended to be the secondary:
1. Shut down the mongod process.
2. Remove the dbpath files associated with the process.
3. Restart mongod with the same parameters as before, i.e. --replSet, etc.
4. Run rs.add() command on the primary node.
Note: In order to allow for automatic failover, your replica set
configuration should have at least 3 nodes.
See Replica Set Architecture