MongoDB backup plan

前端 未结 4 830
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-30 15:10

I want to switch from MySQL to MongoDB but great data losses (more than 1 hour) are not acceptable for me.

I need to have 3 backup plans:

  1. Hourly

4条回答
  •  不思量自难忘°
    2021-01-30 15:16

    1. The fsync command flushes the data to disk. It is executed each 60 seconds by default, but can be configured using the --syncdelay command line parameter.

    2. The documentation on backups has some good pointers for daily and weekly backups. For the daily backup, a master-slave configuration seems like the best option, as it will only sync changes.

    3. For the weekly backup you can also use a master-slave configuration, or replication. Another option is the mongodump utility, which will back-up the entire database. It is capable of creating backups while the database is running, so you can run it on the main database or one of the slaves. You can also lock the slave before backing it up.

提交回复
热议问题