1

我在 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 用户具有适当的权限。谁能解释为什么这没有开始?我可以使用配置以 root 身份手动启动

我应该提到这样做是有效的:

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

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

4

2 回答 2

1

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

于 2012-06-25T10:40:15.003 回答
-1

""" 目录对 mongodb 用户具有适当的权限。"""

显然你的假设是错误的。我们应该相信您的假设还是清除错误信息?想想吧!

于 2012-06-09T10:28:49.277 回答