MongoDB Yaml 配置文件无法识别的选项:存储 [英] MongoDB Yaml config file Unrecognized Option:Storage
问题描述
我们正在尝试使用配置文件设置 mongodb 的远程访问,并且在运行 bin 文件夹中的配置文件时遇到问题.当我们通过 YAML Lint 放置脚本时,它说它是有效的,但是当我们在命令提示符下运行我们的文件时,它会交换两个错误:1)无法识别的选项:存储和 2)无法识别的选项:系统日志
We are trying to set up mongodb's remote access by using a config file, and are having trouble running the config file in the bin folder. When we put our script through YAML Lint it says its valid, but when we run our file in command prompt it interchanges two errors 1) Unrecognized Option: Storage and 2) Unrecognized Option: SystemLog
This is our config file
storage:
dbPath: C:\data\db
enabled: true
systemLog:
destination: file
logAppend: true
logpath: C:\data\log\mongo.log
net:
port: 27017
bindIp: 127.0.0.1
我们在命令提示符下的命令是
our command in command prompt is
mongod -f mongo.config.txt
请帮忙 <3
推荐答案
这是由于 yaml 语法无效造成的.就我而言,我错过了 dbPath 和 value 之间的空格
This happen due to invalid yaml syntax. In my case, i missed the space between dbPath and value
不正确
storage:
dbPath:"./data/db"
正确
storage:
dbPath: "./data/db"
这篇关于MongoDB Yaml 配置文件无法识别的选项:存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!