简体   繁体   English

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

[英]MongoDB service failing to start after db move

My MongoDB install on Amazon EC2 ran out of disk space, so I created a new EBS volume, shut down the MongoDB service cleanly, copied the DB files to the new volume, remounted in the same position as the old partition and tried to restart the service, but I'm getting this error: 我在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

Directory has appropriate permissions for the mongodb user. 目录对mongodb用户具有适当的权限。 Can anyone shed any light on why this is not starting? 谁能阐明为什么不开始? I can start manually as root using the config 我可以使用配置以root身份手动启动

I should mention that doing this works: 我应该提到这样做是可行的:

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

And I'm using MongoDB 2.0.5 from the 10-gen apt repositories. 我正在使用10代apt存储库中的MongoDB 2.0.5。

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

""" Directory has appropriate permissions for the mongodb user. """ “”“目录对mongodb用户具有适当的权限。”“”

Obviously your assumption is wrong. 显然您的假设是错误的。 Should we trust your assumptions or clear error messages? 我们应该相信您的假设还是清除错误消息? Think about it! 想想看!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM