search

Home  >  Q&A  >  body text

数据备份 - mongodb数据库如何定时备份?上线的项目,mongodb需要注意什么?

如题,mongodb数据库如何实现定时备份,目前数据库在阿里云上,为了安全,如何实现每天或者一定时间自动备份到另一个服务器上?
mongodump 如何时间定时自动执行?
已经上线的项目,后期维护需要注意什么??

伊谢尔伦伊谢尔伦2835 days ago818

reply all(2)I'll reply

  • 给我你的怀抱

    给我你的怀抱2017-04-25 09:04:39

    If you want to execute it regularly, just use crontab under Linux.

    But I think that in order to improve the availability of online mongoDB, it is most appropriate to use replica sets. When a mongo instance hangs, it automatically switches to the exception one. Also, in certain scenarios, replica sets can improve read performance. Of course, the premise is that you have extra machines.

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-04-25 09:04:39

    mongodump does not seem to have a timing option, but it is possible if the operating system is used. For example, in Linux, you can use the vi editor to edit and execute mongodump -u -p -d -h, and then use the crontab command to start vi regularly to achieve the purpose of scheduled backup.

    reply
    0
  • Cancelreply