gpt4 book ai didi

linux - 全局初始化失败 : FileRenameFailed: Could not rename preexisting log file

转载 作者:行者123 更新时间:2023-12-04 19:26:39 25 4
gpt4 key购买 nike

尝试启动 mongo 守护程序时出现此错误。

CONTROL [main] Failed global initialization: FileRenameFailed: Couldnot rename preexisting log file"/var/lib/mongodb/log/mongod.log" to"/var/lib/mongodb/log/mongod.log.2021-12-02T14-32-24"; runwith --logappend or manually remove file: Permission denied


配置
storage:
dbPath: "/var/lib/mondodb/data"

systemLog:
destination: file
path: "/var/lib/mongodb/log/mongod.log"
mongodb拥有 /var/lib/mongodb 的所有权和子目录。权限应该没问题。
mondodb目录
drwxr-xr-x 2 mongodb mongodb 4096 Dec  2 15:42 config
drwxr-xr-x 2 mongodb mongodb 4096 Dec 2 15:41 data
drwxr-xr-x 2 mongodb mongodb 4096 Dec 2 15:42 log
服务本身也不会运行 > sudo service mongod status
● mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2021-12-06 17:09:38 GMT; 1s ago
Docs: https://docs.mongodb.org/manual
Process: 24234 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=100)
Main PID: 24234 (code=exited, status=100)

Dec 06 17:09:37 GEL-R90VQK84 systemd[1]: Started MongoDB Database Server.
Dec 06 17:09:38 GEL-R90VQK84 systemd[1]: mongod.service: Main process exited, code=exited, status=100/n/a
Dec 06 17:09:38 GEL-R90VQK84 systemd[1]: mongod.service: Failed with result 'exit-code'.

最佳答案

您以 root 身份运行守护进程?
检查文件的所有权

/var/lib/mongodb/log/mongod.log

关于linux - 全局初始化失败 : FileRenameFailed: Could not rename preexisting log file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70202483/

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