无法启动mongodb服务

时间:2015-06-13 01:35:45

标签: linux mongodb

我尝试从root用户启动mongodb服务,但它无法打开文件j._8的错误,我也检查了权限。这之前工作正常。

String infoQuery = "Select * from bookinfo where name = ?";
// ...
preparedStatement = conn.prepareStatement(infoQuery);
preparedStatement.setString(1, theName);
// ...

这是日记文件夹。

couldn't open /data/mongodb/mongodb/data/journal/j._8 errno:13 Permission denied
Assertion: 13544:recover error couldn't open /data/mongodb/mongodb/data/journal/j._8
0xaf8c41 0xabedb9 0xabef3c 0x7400a2 0x740305 0x740828 0x740a82 0x72c8ef 0x55ca94 0x55d6cd 0x5641ae 0x565789 0x7f1bd649f76d 0x557c59
 /usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x21) [0xaf8c41]
 /usr/bin/mongod(_ZN5mongo11msgassertedEiPKc+0x99) [0xabedb9]
 /usr/bin/mongod() [0xabef3c]
 /usr/bin/mongod(_ZN5mongo3dur11RecoveryJob11processFileEN5boost11filesystem210basic_pathISsNS3_11path_traitsEEE+0x292) [0x7400a2]
 /usr/bin/mongod(_ZN5mongo3dur11RecoveryJob2goERSt6vectorIN5boost11filesystem210basic_pathISsNS4_11path_traitsEEESaIS7_EE+0xc5) [0x740305]
 /usr/bin/mongod(_ZN5mongo3dur8_recoverEv+0x1a8) [0x740828]
 /usr/bin/mongod(_ZN5mongo3dur7recoverEv+0x22) [0x740a82]
 /usr/bin/mongod(_ZN5mongo3dur7startupEv+0x7f) [0x72c8ef]
 /usr/bin/mongod(_ZN5mongo14_initAndListenEi+0x434) [0x55ca94]
 /usr/bin/mongod(_ZN5mongo13initAndListenEi+0x1d) [0x55d6cd]
 /usr/bin/mongod() [0x5641ae]
 /usr/bin/mongod(main+0x9) [0x565789]
 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f1bd649f76d]
 /usr/bin/mongod(__gxx_personality_v0+0x469) [0x557c59]
 dbexception during recovery: 13544 recover error couldn't open /data/mongodb/mongodb/data/journal/j._8
 exception in initAndListen: 13544 recover error couldn't open /data/mongodb/data/journal/j._8, terminating
 dbexit:
 shutdown: going to close listening sockets...
 shutdown: going to flush diaglog...
shutdown: going to close sockets...
shutdown: waiting for fs preallocator...
shutdown: lock for final commit...
shutdown: final commit...
shutdown: closing all files...
closeAllFiles() finished
shutdown: removing fs lock...
dbexit: really exiting now

我无法以cat或更少的root身份打开j._8文件。请帮忙解决这个问题。

提前致谢

1 个答案:

答案 0 :(得分:3)

chmod -R 777 /data/db

为我解决了这个问题。