数据库移动后MongoDB服务无法启动

时间:2012-06-09 10:09:34

标签: mongodb

我在Amazon EC2上安装的MongoDB用完了磁盘空间,因此我创建了一个新的EBS卷,干净地关闭了MongoDB服务,将数据库文件复制到新卷,重新安装在与旧分区相同的位置并尝试重新启动服务,但我收到此错误:

Sat Jun  9 10:03:30 [initandlisten] MongoDB starting : pid=24466 port=27017 dbpath=/db/mongo 64-bit host=ip-10-234-7-0
Sat Jun  9 10:03:30 [initandlisten] db version v2.0.5, pdfile version 4.5
Sat Jun  9 10:03:30 [initandlisten] git version: 1bb4de4630302fad8af53824ca4f627db490b753
Sat Jun  9 10:03:30 [initandlisten] build info: Linux ip-10-110-9-236 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_41
Sat Jun  9 10:03:30 [initandlisten] options: { config: "/etc/mongodb.conf", dbpath: "/succeed/db/mongo", logappend: "true", logpath: "/var/log/mongodb/mongodb.log" }
Sat Jun  9 10:03:30 [initandlisten] journal dir=/db/mongo/journal
Sat Jun  9 10:03:30 [initandlisten] recover : no journal files present, no recovery needed
Sat Jun  9 10:03:30 [initandlisten] warning couldn't write to / rename file /db/mongo/journal/prealloc.0
Sat Jun  9 10:03:30 [initandlisten] couldn't open /db/mongo/MyDB_Mongo.ns errno:1 Operation not permitted
Sat Jun  9 10:03:30 [initandlisten] error couldn't open file /db/mongo/MyDB_Mongo.ns terminating
Sat Jun  9 10:03:30 dbexit: 
Sat Jun  9 10:03:30 [initandlisten] shutdown: going to close listening sockets...
Sat Jun  9 10:03:30 [initandlisten] shutdown: going to flush diaglog...
Sat Jun  9 10:03:30 [initandlisten] shutdown: going to close sockets...
Sat Jun  9 10:03:30 [initandlisten] shutdown: waiting for fs preallocator...
Sat Jun  9 10:03:30 [initandlisten] shutdown: lock for final commit...
Sat Jun  9 10:03:30 [initandlisten] shutdown: final commit...
Sat Jun  9 10:03:30 [initandlisten] shutdown: closing all files...
Sat Jun  9 10:03:30 [initandlisten] closeAllFiles() finished
Sat Jun  9 10:03:30 [initandlisten] journalCleanup...
Sat Jun  9 10:03:30 [initandlisten] removeJournalFiles
Sat Jun  9 10:03:30 [initandlisten] shutdown: removing fs lock...
Sat Jun  9 10:03:30 dbexit: really exiting now

目录对mongodb用户具有适当的权限。任何人都可以解释为什么这不开始?我可以使用config

以root身份手动启动

我应该提到这样做有效:

$ sudo su mongodb
$ mongod --config /etc/mongodb.conf &

我正在使用来自10-gen apt存储库的MongoDB 2.0.5。

2 个答案:

答案 0 :(得分:1)

问题是由mongodb用户的不充分权限引起的。修复权限后重启mongodb服务应该可以解决问题。

答案 1 :(得分:-1)

“”” 目录具有mongodb用户的适当权限。 “”“

显然你的假设是错误的。我们应该相信您的假设或明确的错误信息吗? 想一想!