[DOCS-3958] Comment on: "manual/reference/command/repairDatabase.txt" Created: 28/Aug/14 Updated: 03/Nov/17 Resolved: 28/Aug/14 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 01112017-cleanup |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Kay Agahd | Assignee: | Stennie Steneker (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | collector-298ba4e7 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Location: http://docs.mongodb.org/manual/reference/command/repairDatabase/ |
||
| Participants: | |
| Days since reply: | 9 years, 24 weeks, 5 days ago |
| Description |
|
What about sharding? Can db.repairDatabase() be run against a router (mongos)? Will mongos run the command for a sharded database on all shards and on all replicaSet members simultaneously? What happens if only one replicaSet member doesn't have enough free disk space? Will it cancel the command on all the other mongod instances as well? How is it possible to pass the repairpath parameter if running the command against mongos? If it's not possible, do we need to run the command against every mongod instance of the sharded system or "only" against the primary of every replicaSet/shard? |
| Comments |
| Comment by Kay Agahd [ 29/Aug/14 ] |
|
Thanks Stephen! The reason why we want to repairDatabase the whole sharded system is that the dbs is used for testing purposes for different teams who are using different databases. Once a test suite has been run, mongodb does not free up disk space even if the database has been emptied. If all databases grow continously without ever freeing up disk space, we would run out of disk space some day. That's why we want to run repairDatabase on some databases after some time. I've posted a thread in mongodb's user forum: |
| Comment by Stennie Steneker (Inactive) [ 28/Aug/14 ] |
|
Hi, The DOCS project is for feedback on the MongoDB documentation (http://docs.mongodb.org). For support questions, please post on the mongodb-user discussion group or StackOverflow. The mongodb-user group is better for open-ended or multiple questions, whereas StackOverflow is suited to specific single questions. MongoDB team members are active on both of these forums along with our large community of users. As far as `db.repairDatabase()` on a sharded cluster goes, I would post a follow-up question on what you are trying to achieve with the repair (eg. is this to reduce disk space usage, correct a suspected storage error, ...). You do not want to run repair on a sharded cluster as as whole and should consider the repair operations against each shard. The repair command is a blocking operation that rebuilds your entire database, and if you have a suspected storage error you should definitely ask for advice before running a repair. There are different approaches depending on what you are trying to resolve, your deployment configuration, and whether you are trying to minimise downtime during the repair/maintenance operations. I look forward to helping you on the appropriate forums. Thanks, |