开发者

Incremental backups from server to local machine

开发者 https://www.devze.com 2023-03-29 17:04 出处:网络
My live site is using mongodb to store user activities on the site. I am having a single server running monogdb. I cant afford a second server for master slave replication.

My live site is using mongodb to store user activities on the site.

I am having a single server running monogdb. I cant afford a second server for master slave replication.

my problem is i want to take the dump of server's mongodb database everyday and restore it to my local machine so that i can query on my local machine.I know how to dump and restore but the issue is every day i have to dump the entire database from server and restore it from the scrat开发者_开发问答ch in my local machine ..it takes a lot of time.

so my question is ..is there any way to have incremental backup in mongodb so that i have to dump and restore only single day data as it will take less time.


i do not know much about mongodb, but i have an idea.

i think you can introduce your local mongodb instance as a slave of master production db, and make slave only writable if possible, for preventing live system making selects from your local.

this way can work because slaves keeps track of master writes and deletes and try to make themselves as a copy of master. And there is a good reason to do that is a slave doesn't have to be online always, when it becomes online, slave will check masters list (this list lenght like 1hour or 1 day is configurable at master) and copy datas from master as quick as possible.

Once you dump master to your local, then you can backup your data twice a day with this method i think.

0

精彩评论

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