Reputation: 175
I have run into a problem on a remote linux server running Ubuntu. I ran a computationally intensive process using MongoDB, and the Mongo records used up all of the hard drive space on the machine. I tried using db.dropDatabase(), but I got an error message. Someone advised me to uninstall MongoDB, but this did not work either, and now I cannot reinstall it, as there is not enough space left.
Is there a way I can manually delete the remaining mongo records? Thanks.
Upvotes: 0
Views: 3696
Reputation: 2302
In my case, it hasn't any relation with disk space. It was the number of watches allowed by the system
Check this: https://stackoverflow.com/a/34664097/1556106
Upvotes: 0
Reputation: 350
You can identify where MongoDB stores data from the configuration file.
The location of this file will depend how you installed it, Ubuntu's own packages and the ones provided by 10gen differ. Have a look at either /etc/mongod.conf
or /etc/mongodb.conf
.
In the configuration you will find the following:
# Where to store the data.
dbpath=/mnt/data/mongodb
This is your data directory which you can delete if you accept losing all of your data. As stated elsewhere you will need to be root
.
Note that if you have filled your root partition it will be difficult, but not impossible, to recover the data "online" (without dumping it out to another drive and restoring to MongoDB). This mongolab blog article from the explains a number of disk space issues nicely.
Upvotes: 1
Reputation: 101
You are not able to delete anything from a server with 100% disk space as a regular user, however linux reserves some space for the root user. If you login to your server as root you should be able to delete the data(in /data/db/
by default). Additionally make sure that your mongodb server is shut down as linux does not completely delete open files.
Upvotes: 0