I have master and slave
running on different port. But when I close master
the slave goes down
too. I understand why this is happening. I want that when 开发者_C百科master goes down the slave become a new master without restarting the mongod with --master
option. And My mongodb connection never got down
.
You need use the replicaSet system instead of the Master/Slave system in MongoDB.
all documentation about Replicat Set is on MongoDB wiki : http://www.mongodb.org/display/DOCS/Replica+Sets
精彩评论