문제

I have a replica-set.

And I run out of disk space on my secondary instances.

There is no space on disk to run db.repairDatabase()

Is there any other way to free some disk space?

I was thinking:

  1. bring secondary down
  2. Delete all data
  3. run db.repairDatabase() if deleting data will allow it
  4. Bring it back up.

WIll this work?

UPDATE

Worth to mention that I can't currently SSH to servers. Only using mongo client now.

도움이 되었습니까?

해결책

No that won't work - there has to be a database there to run db.repairDatabase() on. However, what works just as well is to bring the secondary down, delete the database files and then bring it back it up. This will force a re-sync with the primary which will in effect do the same thing as a db.repairDatabase() as it will recreate the data files from scratch.

However, in order to delete the datafiles you'll need to ssh in to the instance. If you cannot ssh in you have fairly significant issues that will interfere with any attempt to recover the secondary.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top