7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

mongodbででっかいデータを入れすぎてファイルがけせない場合の対処法

Last updated at Posted at 2013-06-18

でっかいデータをずどーんと入れてファイル容量が圧迫すると
mongodb本体がロックをかけてremove()ができなくなります。

db.access_before.remove()
Can't take a write lock while out of disk space

re….removeができない

対処法

その1 mongoをまず止める

止めましょう

/etc/init.d/mongod stop

その2 lockfileを削除する

デフォルトの設定なら/var/lib/mongoにあります

cd /path/to/mongo
rm /path/to/mongo/mongod.lock

その3 再度mongoを起動させる

起動させましょう

/etc/init.d/mongod start

その4 もう一回remove()を使用して消去する

消去しましょう

mongo
> use apache
> db.access_before.count()
0

消せました。

7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?