开发者

How to run slave automatically when master is down in mongodb?

开发者 https://www.devze.com 2023-02-02 09:00 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消