Quick Contact

Mongodb convert secondary into arbiter

1. Shut down the secondary ny1lv4058 
 
mongo --port 10001
use admin
db.adminCommand({shutdown : 1, force : true})
 
 
mongo --port 10002
use admin
db.adminCommand({shutdown : 1, force : true})
mongo --port 27017
use admin
db.adminCommand({shutdown : 1, force : true})
 
 
 
2. Remove the secondary from primary NY1ld249 
 
mongo --port 10001
 
rs.remove("learn-mongo3:10001")
 
 
 
mongo --port 10002
 
rs.remove("learn-mongo3:10002")
 
 
3. Verify that the replica set no longer includes the secondary by calling the rs.conf()
 
 
 
4. Move the secondary’s data directory to an archive folder on ny1lv4058
 
mv /data/ /data_OLD
 
5. Create a new, empty data directory on ny1lv4058
 
mkdir /data
 
6.Restart mongod on ny1lv4058
 
7.convert the secondary to an arbiter using the rs.addArb() method from primary NY1ld249 
mongo --port 10001
 
rs.addArb("learn-mongo3:10001")
 
mongo --port 10002
 
rs.addArb("learn-mongo3:10002")
 
8. verify rs.status
 
 
http://docs.mongodb.org/manual/tutorial/convert-secondary-into-arbiter/#replica-set-convert-secondary-to-arbiter-same-port
Additional Articles
X

Partners

© 2013 XGlobe Online Ltd.