Shutting Down Sharded MongoDB Cluster Cleanly -


i have mongodb setup mongos server, config server, , 2 shards of 3 mongod (master-slave) servers each. ensure when shut them down shut down cleanly not lose data queued or while server determining shard write to, etc..

what current best practice shutting down cluster of mongodb servers?

which order things best shut down in, issue fsync, write locks, etc..

i'd write script automate facilitate backups, new code pushes, , else otherwise requires database in consistent state.

these best practices still being cleared up.

with setup here's how server maintenance.

backups

find non-primary in each replica set. perform fsync & lock. copy, tar, backup. unlock db.

you should able on replica set. if you're worried, can fsync & lock , shutdown.

compressions

you want compress data @ point. easiest way again fsync & lock , db.repairdatabase(). repair command "defrag / compression" you. above, can down shutdown.

code pushes

ideally, there little needs consistent regards code push. @ worst, you'll need manage index creation / deletion. needs managed separately don't want devs randomly adding indexes on production db.

monitoring

this way more complex topic, you'll want watch things "who's master", "what write throughput on each node", "how ram using", "how data shifting between nodes". there limited tools doing right now, expect roll own.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -