mongodb启动提示Error opening config file: Is a directory

启动命令为: mongod -f /opt/servers/mongodb_demo/mongodb/conf/mongod.conf

img


教科书上的命令,查询网上都用install呢
请问谁可以告诉我怎么回事以及怎么解决

根据错误提示,你确认一下/opt/servers/mongodb_demo/mongodb/conf/mongod.conf到底是文件还是目录哈
mongod --help看看有啥有用的信息,比如默认的配置文件路径等等

改下运行命令
mongod --dbpath "D:\MongoDB\database\data" --logpath "D:\MongoDB\database\log\mongodb.log" --install --serviceName "MongoDB"