mongodb modify replica set node ip

Enter the command operation side of mongodb, /usr/mongo/mongodb-linux-i686-3.2.4/bin/mongo
1. Delete the node in the mongodb replica set
rs.remove('ip:port')
2. Add the mongodb replica set node
rs.add('ip:port')
3. Modify the ip of the mongodb replica set node
var config = rs.config()
config.members[node cursor].host = 'ip:post'
rs.reconfig(config)
If an error is reported, You can try to forcibly override
rs.reconfig(config,{force,true})

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326247506&siteId=291194637