【问题标题】:Error while installing mongo shell on macbook: Attempted to create a lock file on a read-only directory在 macbook 上安装 mongo shell 时出错:尝试在只读目录上创建锁定文件
【发布时间】:2017-07-31 19:24:43
【问题描述】:

两天以来我一直在尝试安装 mongo shell,但我遇到了同样的错误,该错误在任何帖子中都没有解决。已经看过很多关于这个的教程,但它并不富有成效。我希望有人能把我带回赛道。提前致谢。

2017-08-01T00:46:18.842+0530 I CONTROL  [init and listen] MongoDB starting : pid=28050 port=27017 dbpath=/data/db 64-bit host=Salonis-MacBook-Pro-2.local
2017-08-01T00:46:18.842+0530 I CONTROL  [init and listen] db version v3.4.6
2017-08-01T00:46:18.843+0530 I CONTROL  [init and listen] git version: c55eb86ef46ee7aede3b1e2a5d184a7df4bfb5b5
2017-08-01T00:46:18.843+0530 I CONTROL  [init and listen] OpenSSL version: OpenSSL 0.9.8zh 14 Jan 2016
2017-08-01T00:46:18.843+0530 I CONTROL  [init and listen] allocator: system
2017-08-01T00:46:18.843+0530 I CONTROL  [init and listen] modules: enterprise 
2017-08-01T00:46:18.843+0530 I CONTROL  [init and listen] build environment:
2017-08-01T00:46:18.843+0530 I CONTROL  [init and listen]     distarch: x86_64
2017-08-01T00:46:18.843+0530 I CONTROL  [init and listen]     target_arch: x86_64
2017-08-01T00:46:18.843+0530 I CONTROL  [init and listen] options: {}
2017-08-01T00:46:18.867+0530 I STORAGE  [init and listen] exception in initAndListen: 20 Attempted to create a lock file on a read-only directory: /data/db, terminating
2017-08-01T00:46:18.867+0530 I NETWORK  [init and listen] shutdown: going to close listening sockets...
2017-08-01T00:46:18.867+0530 I NETWORK  [init and listen] shutdown: going to flush dialog...
2017-08-01T00:46:18.867+0530 I CONTROL  [init and listen] now exiting
2017-08-01T00:46:18.867+0530 I CONTROL  [init and listen] shutting down with code:100

【问题讨论】:

  • 似乎无法写入数据目录:试图在只读目录上创建锁定文件:/data/db
  • 我编辑了您问题的标题以包含手头的错误。我还编辑了您的问题正文,以便您的日志正确呈现 - 请参阅the editing help 了解有关格式的更多信息。祝你好运!

标签: mongodb terminal terminate mongo-shell


【解决方案1】:

只需输入$ sudo mongod

然后控制台显示waiting for connections of 27017

参考是https://scotch.io/tutorials/an-introduction-to-mongodb

【讨论】:

    猜你喜欢
    • 2023-03-24
    • 2021-10-30
    • 2020-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-06
    • 2022-06-13
    • 2021-01-06
    相关资源
    最近更新 更多