Unable to run mongod on Mac OS X

Nojan

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?

BatScream

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]

編集
0

コメントを追加

0

関連記事

分類Dev

run Mac OS X applications on Linux

分類Dev

How can I run runsnakerun on Mac OS X inside a conda environment?

分類Dev

How to run a Python 3 tkinter app without opening any Terminal windows in Mac OS X?

分類Dev

Wubi Install for Mac OS X

分類Dev

Mac OS XのJNotify?

分類Dev

openLDAP installation on MAC OS X

分類Dev

Wubi Install for Mac OS X

分類Dev

Dragonegg on Mac OS X Issues

分類Dev

Coding works in Windows OS but not in Mac OS( Run time error 1004)

分類Dev

Mac OS Xで同等のldconfig?

分類Dev

Error Installing pymssql on Mac OS X Yosemite

分類Dev

Change mac os x default php version

分類Dev

Open folder for a given path in Mac OS X

分類Dev

What is an equivalent of the adduser command on Mac OS X?

分類Dev

combobox in a toolbar in an AUI Frame in mac os x

分類Dev

Setting Environment Variables on Mac OS X

分類Dev

User login "log" on Mac OS X

分類Dev

Problems starting Suricata on Mac OS X

分類Dev

Docker port expose fails in Mac OS X

分類Dev

Changing Default Shell in Mac OS X

分類Dev

Mac OS X Terminal: mouse support?

分類Dev

OS X: always run app with root privileges

分類Dev

How to run a script at login/logout in OS X?

分類Dev

mongod、mac osx-rlimits警告

分類Dev

mongod run with nohup exits when there is no open connection

分類Dev

git on mac os from homebrew: fatal: unable to access

分類Dev

Could not run Android Studio on my Mac OS Yosemite. Error: The following SDK component was not installed: sys-img-x86-addon-google_apis-google-21

分類Dev

Should I install GPG Suite as root in Mac OS X?

分類Dev

Pythonパスに追加Mac OS X

Related 関連記事

ホットタグ

アーカイブ