vinibgoulart
PROOP
2 months ago
How can I configure my mongodb for use replica set with attached volume in the service?
3 Replies
2 months ago
You'll need to follow these steps:
- Deploy a Replica Set, you can do this manually or use a template (like ) [note: i havent tested or proofed this template, this is just an example]
mongodumpyour existing mongodb database data somewheremongorestoreyour mongodump data to the primary node of the replica set
Notes:
- Make sure you trust the replica-set template you're using
- I'd recommend not deleting your existing service or making changes to it until after you've confirmed the replica-set migration worked. If something goes wrong you'll want something to fallback to
- I'd recommend keeping the mongodump data on your PC for a while, just to be safe - if something goes wrong you'll still have your data
- You can get
mongodumpandmongorestorefrom MongoDB CLI DB Tools
2 months ago
I'm going to bed now but I'll check back here when I wake up