我有一个 mongod.conf,其中包含
processManagement:
fork: true
但是当我运行
mongod --config ./conf/mongod.conf
时,它给了我如下错误:
ERROR: child process failed, exited with error number 48
To see additional information in this output, start without the "--fork" option.
error Command failed with exit code 48.
此外,当我使用
mongod --fork --logpath=./mongo.log
启动 Mongodb 时,它也给了我错误,如下所示:
ERROR: child process failed, exited with error number 100
To see additional information in this output, start without the "--fork" option.
我似乎无法使用 --fork 选项启动 Mongodb。我该如何解决这个问题? 如何使用我的 mongod.conf 设置 Mongodb ?
顺便说一句,我的 Mongodb 版本是 v4.0.4。真的很欣赏
请检查您的配置文件。仔细检查所有目录,例如 logpath、dbpath、pidfilepath... 如果您由 mongod 用户运行,请确保您的目录属于该用户。
mongod 在 tmp 目录中创建一个套接字文件,这可能会在使用不同的文件重新启动时导致错误。 检查 /tmp 目录或日志文件中的 mongo。