mongodb - 当我在终端中输入 mongod 时,我的 MongoDB 不工作
问题描述
我输入 mongod 来创建一个新的数据库,但我得到了这个错误,知道这里发生了什么吗?
mongod
2018-08-28T18:06:36.824+0100 I CONTROL [initandlisten] MongoDB starting : pid=41812 port=27017 dbpath=/data/db 64-bit host=Ruairidhs-MacBook-Pro.local
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] db version v3.6.3
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] git version: 9586e557d54ef70f9ca4b43c26892cd55257e1a5
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] OpenSSL version: OpenSSL 1.0.2n 7 Dec 2017
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] allocator: system
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] modules: none
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] build environment:
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] distarch: x86_64
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] target_arch: x86_64
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] options: {}
2018-08-28T18:06:36.825+0100 I STORAGE [initandlisten] exception in initAndListen: DBPathInUse: Unable to lock the lock file: /data/db/mongod.lock (Resource temporarily unavailable). Another mongod instance is already running on the /data/db directory, terminating
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] now exiting
2018-08-28T18:06:36.825+0100 I CONTROL [initandlisten] shutting down with code:100
解决方案
打开一个新的终端窗口,执行top
,根据错误,你已经有一个mongod的实例在运行,所以你需要找到它并终止它。
推荐阅读
- python - 如何将(多变量)时间序列加载到神经网络/LSTM 中
- .net - .NET Core c# 项目 - 所有 nuget 包都位于哪里?
- python - 更新后如何在 Biopython 中创建没有 Bio.Alphabet 模块的 IUPAC dna 对象?
- c# - 让忍者从崩溃的地方开始
- python - 使用 subplot() 在网格中显示多个图像
- css - 出现日历 CSS 背景位置
- python - “utf-8”编解码器无法解码位置 0 中的字节 0xe2:无效的继续字节(sitecustomize.py,第 7 行)
- java - Java HotSpot VM 命令行 HeapDumpPath 选项将主机名用于生成的 .hprof
- html - 防止内容扩展到 Div 之外(并使其滚动)
- list - 在 Prolog 中实现自动机