JohnSean
JohnSean

Reputation: 11

MongoDB Yaml config file Unrecognized Option:Storage

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

Please Help <3

Upvotes: 1

Views: 18699

Answers (4)

Huneshwar Kumar Yadav
Huneshwar Kumar Yadav

Reputation: 31

Now in updated mongod, enabled key is not present. so try removing enabled and journal key as below

storage: 
  dbPath: C:\\data\\db
systemLog: 
  destination: file
  logAppend: true
  path: C:\\data\\log\\mongo.log
net:
  port: 27017
  bindIp: 127.0.0.1  

Upvotes: 3

blazehub
blazehub

Reputation: 1960

This happen due to invalid yaml syntax. In my case, i missed the space between dbPath and value

Incorrect

storage:
    dbPath:"./data/db"

Correct

storage:
    dbPath: "./data/db"

Upvotes: 2

swateek
swateek

Reputation: 7570

This happened with me because I deleted a space in the configuration file.

storage:
  dbPath: /var/lib/mongo
  journal:
    enabled: true

I got this error, when the configuration file had the below state, note the gap before enabled:

storage:
  dbPath: /var/lib/mongo
  journal:
  enabled: true

Upvotes: 1

kevinadi
kevinadi

Reputation: 13775

You have a couple of errors in your config (for MongoDB 3.2):

  • There is no storage.enabled option, I think you meant storage.journal.enabled
  • There is no systemLog.logpath option, this should be systemLog.path

This modified config file seems to work as expected:

storage: 
  dbPath: C:\\data\\db
  journal:
    enabled: true
systemLog: 
  destination: file
  logAppend: true
  path: C:\\data\\log\\mongo.log
net:
  port: 27017
  bindIp: 127.0.0.1  

You can browse for more options in the Configuration File Options page

Upvotes: 2

Related Questions