gpt4 book ai didi

linux - MongoDB 不运行

转载 作者:太空宇宙 更新时间:2023-11-04 11:51:00 26 4
gpt4 key购买 nike

我刚刚在 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com