MongoDB不能以fork开头?

MongoDB不能以fork开头?,mongodb,fork,Mongodb,Fork,我有一个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

我有一个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.
ERROR: child process failed, exited with error number 100
To see additional information in this output, start without the "--fork" option.
另外,当我用
mongod--fork--logpath=./mongo.log
启动Mongodb时,它也给了我如下错误:

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.
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用户运行,请确保您的目录由该用户拥有。

可能重复,但该帖子中的解决方案无法解决我的问题。我认为您有一些不同的问题。在第一种情况下,您试图使用一个已经在使用的端口(另一个MongoDB进程正在运行,或者这个端口被其他程序占用)。在第二种情况下,您有权限问题(请查看)。