2

[BACKUP COMMAND]: mongodump -u username -p password -d database --port port -o output path.

[ISSUE]: error writing data for collection to disk: error reading collection: Closed explicitly.

The storage requirements of my MongoDB database are constantly increasing. So far the database is using 20 GB of disk space and I am encountering errors when I want to dump the database. It always fails and the above issue is displayed in the terminal shell when I use the above mongodump command. I have to reissue the mongodump command again and again until the backup of the database finishes.

So my questions are:

  • Is there a good alternative database backup tool/command for MongoDB?
  • Is there a stable and fast backup command for large-scale MongoDB databases?
  • Am I using the correct procedure?
henry vans
  • 21
  • 1
  • 3
  • 1
    I feel your pain. Do you have a question? – Gerard H. Pille May 17 '18 at 06:33
  • 1
    Could you add a question and possibly reword your question? It is hard to understand what your problem is and what issue you are trying to resolve. – John K. N. May 17 '18 at 07:14
  • yeah, I have reworded my question. and now I' m not sure it is easy-understand for you? – henry vans May 18 '18 at 03:03
  • Based on your recent edit, I have tried to reword your question to increase readability. I hope you agree. If you have any objections, please visit the question's revisions and rollback to your version. – John K. N. May 18 '18 at 06:03
  • ok, thank you very much. by the way, are you an administrator of this website? – henry vans May 18 '18 at 07:43
  • There have been many bug fixes & improvements since MongoDB 3.4.1 was released. Can you try with the latest 3.4.x version of mongodump (currently 3.4.15)? If that doesn't resolve the issue, can you please confirm: what type of deployment you have (standalone, replica set, or sharded cluster), your specific O/S version, and your mongodump command line. For alternative backup approaches, see Backup Methods in the MongoDB manual. For larger or more complex deployments, typical backup approaches are to use backup agents or filesystem snapshots. – Stennie May 20 '18 at 23:14
  • thanks for your advice, but I have a question, I don't know whether it would affect the functionality of the previous database or not when I update mongo version. I have replica set deployment on my machines, and O/S version is Ubuntu16.04, and my backup command is mongodump -u username -p password -d database --port port -o output path. – henry vans May 22 '18 at 01:22

1 Answers1

1

A quote from the horse's mouth (ie. https://docs.mongodb.com/manual/core/backups/#back-up-with-mongodump):

mongodump and mongorestore are simple and efficient tools for backing up and restoring small MongoDB deployments, but are not ideal for capturing backups of larger systems.

Gerard H. Pille
  • 3,255
  • 1
  • 9
  • 13