Я получил сообщение об ошибке «дочерний процесс завершился с ошибкой номер 45» после ввода «service mongod restart» и проверил /var/log/mongo/mongo.log, как показано ниже:
SERVER RESTARTED
Sat Dec 21 12:28:59.115 [initandlisten] MongoDB starting : pid=1446 port=27017 dbpath=
/var /lib/mongo 32-bit host=server.xfloyd.com.ar
Sat Dec 21 12:28:59.115 [initandlisten]
Sat Dec 21 12:28:59.115 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
Sat Dec 21 12:28:59.115 [initandlisten] ** 32 bit builds are limited to
less than 2GB of data (or less with --journal).
Sat Dec 21 12:28:59.115 [initandlisten] ** Note that journaling defaults to off for
32 bit and is currently off.
Sat Dec 21 12:28:59.115 [initandlisten] ** See http://dochub.mongodb.org/core/32bit
Sat Dec 21 12:28:59.115 [initandlisten]
Sat Dec 21 12:28:59.115 [initandlisten] db version v2.4.6
Sat Dec 21 12:28:59.115 [initandlisten] git version: b9925db5eac369d77a3a5f5d98a145eaaacd9673
Sat Dec 21 12:28:59.115 [initandlisten] build info: Linux bs-linux32.10gen.cc 2.6.21.7-2.
fc8xen #1 SMP Fri Feb 15 12:39:36 EST 2008 i686 BOOST_LIB_VERSION=1_49
Sat Dec 21 12:28:59.115 [initandlisten] allocator: system
Sat Dec 21 12:28:59.115 [initandlisten] options: { config: "/etc/mongod.conf", dbpath:
"/var/lib/mongo", fork: "true", logappend: "true", logpath: "/var/log/mongo/mongod.log"
, pidfilepath: "/var/run/mongodb/mongod.pid" }
Sat Dec 21 12:28:59.146 [initandlisten] couldn't open /var/lib/mongo/local.ns errno:
13 Permission denied
Sat Dec 21 12:28:59.146 [initandlisten] error couldn't open file /var/lib/mongo/
local.ns terminating
Sat Dec 21 12:28:59.146 dbexit:
Sat Dec 21 12:28:59.146 [initandlisten] shutdown: going to close listening sockets...
Sat Dec 21 12:28:59.146 [initandlisten] shutdown: going to flush diaglog...
Sat Dec 21 12:28:59.146 [initandlisten] shutdown: going to close sockets...
Sat Dec 21 12:28:59.146 [initandlisten] shutdown: waiting for fs preallocator...
Sat Dec 21 12:28:59.146 [initandlisten] shutdown: closing all files...
Sat Dec 21 12:28:59.146 [initandlisten] closeAllFiles() finished
Sat Dec 21 12:28:59.146 [initandlisten] shutdown: removing fs lock...
Sat Dec 21 12:28:59.146 dbexit: really exiting now
решение1
Sat Dec 21 12:28:59.146 [initandlisten] error couldn't open file /var/lib/mongo/local.ns
terminating
Эта строка наиболее диагностична. Проверьте, /var/lib/mongo
достаточны ли права для пользователя, от имени которого запущена служба Mongo (или, если она вызывается напрямую, для пользователя, вызывающего mongodb). Файл local.ns
представляет собой файл базы данных Mongo, который по умолчанию хранится в /var/lib/mongo
.