I've installed mongodb
using homebrew
. The mongo
command runs as expected in terminal but when I run mongod
in terminal it returns this:
mongod --help for help and startup options
2014-09-27T12:55:42.705+0330 [initandlisten] MongoDB starting : pid=3704 port=27017 dbpath=/data/db 64-bit host=Your-MacBook-Pro.local
2014-09-27T12:55:42.705+0330 [initandlisten]
2014-09-27T12:55:42.705+0330 [initandlisten] ** WARNING: soft rlimits too low. Number of files is 256, should be at least 1000
2014-09-27T12:55:42.705+0330 [initandlisten] db version v2.6.4
2014-09-27T12:55:42.705+0330 [initandlisten] git version: nogitversion
2014-09-27T12:55:42.705+0330 [initandlisten] build info: Darwin Your-MacBook-Pro.local 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49
2014-09-27T12:55:42.705+0330 [initandlisten] allocator: tcmalloc
2014-09-27T12:55:42.705+0330 [initandlisten] options: {}
2014-09-27T12:55:42.706+0330 [initandlisten] exception in initAndListen: 10309 Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating
2014-09-27T12:55:42.706+0330 [initandlisten] dbexit:
2014-09-27T12:55:42.706+0330 [initandlisten] shutdown: going to close listening sockets...
2014-09-27T12:55:42.706+0330 [initandlisten] shutdown: going to flush diaglog...
2014-09-27T12:55:42.706+0330 [initandlisten] shutdown: going to close sockets...
2014-09-27T12:55:42.706+0330 [initandlisten] shutdown: waiting for fs preallocator...
2014-09-27T12:55:42.706+0330 [initandlisten] shutdown: lock for final commit...
2014-09-27T12:55:42.706+0330 [initandlisten] shutdown: final commit...
2014-09-27T12:55:42.706+0330 [initandlisten] shutdown: closing all files...
2014-09-27T12:55:42.706+0330 [initandlisten] closeAllFiles() finished
2014-09-27T12:55:42.706+0330 [initandlisten] shutdown: removing fs lock...
2014-09-27T12:55:42.706+0330 [initandlisten] couldn't remove fs lock errno:9 Bad file descriptor
2014-09-27T12:55:42.706+0330 [initandlisten] dbexit: really exiting now
So I can't use mongo class in my php application. Is it caused by some port confliction? Is there any solution to this?
If you see the Exception, it says:
exception in initAndListen:
10309 Unable to create/open lock file: /data/db/mongod.lock
errno:13 Permission denied Is a mongod instance already running?, terminating
Either mongod instance could not create the lock file or a lock file is already present in the location, and the current instance cannot get hold of it, due to improper termination/shutdown of a previously run mongod instance.
To solve this, manually delete the /data/db/mongod.lock
, if it is present and restart the mongod service.
sudo rm /data/db/mongod.lock
In case the lock file is not present, give read/write permissions of the /data/db
directory and restart the instance.
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加