简体   繁体   English

Mongodb启动时出错

[英]Mongodb Error on start

I just downloaded mongodb via homebrew. 我刚刚通过自制软件下载了mongodb。 When I tried starting it by mongod it said that I didn't have the data/db folder for it. 当我尝试通过mongod启动它时,它说我没有data / db文件夹。 I made the folder via sudo command from another stackoverflow page. 我从另一个stackoverflow页面通过sudo命令创建了该文件夹。 Now the error that I'm getting is: 现在我得到的错误是:

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 initAndListen中的异常:10309无法创建/打开锁文件:/data/db/mongod.lock errno:13权限被拒绝mongod实例是否已经运行?,终止

I'm not sure why it's asking me if another instance of mongod is running because I only have one bash shell open. 我不知道为什么它会问我mongod的另一个实例是否正在运行,因为我只打开了一个bash shell。

Any tips would be awesome. 任何提示都会很棒。 Thank you! 谢谢!

Okay, I figured it out. 好的,我明白了。 The command after sudo mkdir -p /data/db is sudo mkdir -p / data / db之后的命令是

sudo chown $USER /data/db sudo chown $ USER / data / db

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM