linux - MongoDB 不运行

标签 linux mongodb archlinux

我刚刚在 arch 中安装了带有 AUR 的 mongoDB 并尝试运行它;

mongod

但它总是说;

2019-05-11T17:07:09.608+0000 I CONTROL  [main] Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'
2019-05-11T17:07:09.611+0000 I CONTROL  [initandlisten] MongoDB starting : pid=27076 port=27017 dbpath=/data/db 64-bit host=manjaro
2019-05-11T17:07:09.611+0000 I CONTROL  [initandlisten] db version v4.0.9
2019-05-11T17:07:09.611+0000 I CONTROL  [initandlisten] git version: fc525e2d9b0e4bceff5c2201457e564362909765
2019-05-11T17:07:09.611+0000 I CONTROL  [initandlisten] OpenSSL version: OpenSSL 1.1.1b  26 Feb 2019
2019-05-11T17:07:09.611+0000 I CONTROL  [initandlisten] allocator: tcmalloc
2019-05-11T17:07:09.611+0000 I CONTROL  [initandlisten] modules: none
2019-05-11T17:07:09.611+0000 I CONTROL  [initandlisten] build environment:
2019-05-11T17:07:09.611+0000 I CONTROL  [initandlisten]     distmod: ubuntu1804
2019-05-11T17:07:09.611+0000 I CONTROL  [initandlisten]     distarch: x86_64
2019-05-11T17:07:09.611+0000 I CONTROL  [initandlisten]     target_arch: x86_64
2019-05-11T17:07:09.611+0000 I CONTROL  [initandlisten] options: { storage: { dbPath: "/data/db", mmapv1: { smallFiles: true } } }
2019-05-11T17:07:09.611+0000 I STORAGE  [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
2019-05-11T17:07:09.612+0000 I NETWORK  [initandlisten] shutdown: going to close listening sockets...
2019-05-11T17:07:09.612+0000 I NETWORK  [initandlisten] removing socket file: /tmp/mongodb-27017.sock
2019-05-11T17:07:09.612+0000 I CONTROL  [initandlisten] now exiting
2019-05-11T17:07:09.612+0000 I CONTROL  [initandlisten] shutting down with code:100

我该怎么办?

最佳答案

2019-05-11T17:07:09.611+0000 I STORAGE  [initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating

您缺少它的 db 目录的路径。使用以下方法在您的根文件夹中创建一个:

sudo mkdir /data/db

这里建议使用 sudo,否则有时 mongoDB 会遇到权限问题。

关于linux - MongoDB 不运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56091108/

相关文章:

node.js - Step 和 Mongodb 驱动@Nodejs

c++ - 从服务器收到的 Wt FastCGI 不完整 header (0 字节)

regex - 负向后断言正则表达式与 grep -P 有意想不到的结果

java - 意外的 mongodb 更新被阻止

java - 多个流中批量写入mongoDB时出错

java - Android 设备监视器未找到 JDK 路径

Linux 中的 Android Studio 难以辨认/不可读的特殊字符

linux - 加载交叉编译的内核模块时出错

linux - Bash:一次有两个 for 循环?

linux - openSUSE 上的 OTRS 安装错误