「service mongod restart」と入力した後、「子プロセスが失敗しました。エラー番号 45 で終了しました」というエラーが表示され、/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
この行は最も診断的です。Mongo/var/lib/mongo
サービスを実行しているユーザー (または直接呼び出されている場合は、mongodb を呼び出すユーザー) の の権限が十分であることを確認します。 ファイルはlocal.ns
Mongo データベース ファイルであり、デフォルトでは に保存されます/var/lib/mongo
。