gpt4 book ai didi

Mongodb 服务无法在 Ubuntu 16.04 上启动

转载 作者:行者123 更新时间:2023-12-04 18:45:22 26 4
gpt4 key购买 nike

当我尝试使用命令 sudo service mongod start 启动 mongodb 服务时,它不起作用。在使用“sudo service mongod status”仔细检查后,发现以下内容:

● mongod.service - High-performance, schema-free document-oriented database
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2017-09-18 21:00:29 CEST; 7s ago
Docs: https://docs.mongodb.org/manual
Process: 21352 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=1/FAIL
Main PID: 21352 (code=exited, status=1/FAILURE)

Sep 18 21:00:29 zeus systemd[1]: Started High-performance, schema-free document-oriented databas
Sep 18 21:00:29 zeus systemd[1]: mongod.service: Main process exited, code=exited, status=1/FAIL
Sep 18 21:00:29 zeus systemd[1]: mongod.service: Unit entered failed state.
Sep 18 21:00:29 zeus systemd[1]: mongod.service: Failed with result 'exit-code'.

配置文件已更改为以下内容:
# Where and how to store data.
storage:
dbPath: /tank/mongo/mongodb
journal:
enabled: true

# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /tank/mongo/log/mongodb/mongod.log

# network interfaces
net:
port: 27017
bindIp: 127.0.0.1

mongodb 用户被授予访问 \tank\mongo 的权限目录使用命令: sudo chown -R mongodb:users /tank/mongo .

最佳答案

原来我应该允许 mongodb:mongodb ,不仅如此;子文件夹没有继承权限,所以我必须在配置中指定的文件夹级别授予权限 /tank/mongo/log/mongodb/ , /tank/mongo/mongodb .

我留下答案,以防它可能对处于类似情况的人有所帮助。

关于Mongodb 服务无法在 Ubuntu 16.04 上启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46286546/

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