2014년 12월 9일 화요일

can't map area of size 0 file

I'm having some trouble starting up my database. I shut it down properly using the shutdown command from the shell but when I start it up it's giving me this: "DBException 10446: mmap: can't map area of size 0 file: /data/test.3". There are 20 something data files for the test database. I'm not sure how/why that data file is size 0 (verified with ls).

I tried repairing and got the same error.

Any suggestions as to what I can do? Is it just a matter of removing that data file or would what cause more problems?



Unfortunately removing the file is unlikely to make things better - frankly, given there is nothing in it, it probably won't make things worse.   I don't suppose this mongod was part of a replica set?



Asya, it's not part of a replica set. Just a single node db (v2.6.4).

I moved test.3 out with no luck:
2014-12-07T08:39:20.790-0600 [initandlisten] test Assertion failure n >= 0 && n < static_cast<int>(_files.size()) src/mongo/db/storage/extent_manager.cpp 109



Do you happen to have a recent backup of the files?

If there is no backup and the data is really important, it might be possible to recover some of it via mongodump --dbpath /path/to/datafiles --repair.

You might be able to get the DBs and collections that way that are in other (unharmed) data files...   



Unfortunately no.

I'll give mongodump a try. Thanks.

Do you know how it would get into this state?



I imagine that it would have had to be some drastic file system error/failure - once a file is allocated, mongod never truncates it to 0 as far as I know (even if everything in it is deleted, the file just remains part of the free list to be available when new data is inserted).

Maybe check various dmesg/system logs/file system logs?


댓글 없음:

댓글 쓰기