Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while starting Mongod with config file option

Tags:

I am not able to start mongod servers with replication using config file. when issue the command

mongod --config /etc/mongod1.conf

throws an error-

Unrecognized option: replSet

Unrecognized option: oplogSizeMB

MongoDB Version: 3.0

# mongod.conf

# for documentation of all options, see:
#   http://docs.mongodb.org/manual/reference/configuration-options/

# where to write logging data.
systemLog:
  destination: file
  logAppend: true
  path: /var/log/mongodb/mongod.log

# Where and how to store data.
storage:
  dbPath: /var/lib/mongo/test
  journal:
    enabled: true
#  engine:
#  mmapv1:
#  wiredTiger:

# how the process runs
processManagement:
  fork: true  # fork and run in background
  pidFilePath: /var/run/mongodb/mongod.pid  # location of pidfile

# network interfaces
net:
  port: 27030
#  bindIp: 127.0.0.1  # Listen to local interface only, comment to listen on all interfaces.


#security:

#operationProfiling:

replication:
replSet: testrep
oplogSizeMB: 1024
#sharding:

## Enterprise-Only Options

please help me.

like image 772
Telen Avatar asked Feb 02 '17 17:02

Telen


People also ask

What is MongoDB config file?

You can configure mongod and mongos instances at startup using a configuration file. The configuration file contains settings that are equivalent to the mongod and mongos command-line options. See Configuration File Settings and Command-Line Options Mapping.

Where is MongoDB config file in Windows?

In your case, read P:\Servers\MongoDB\logs\mongodb. log file.


1 Answers

Just ident replSet and oplogSizeMB lines two spaces to the right. That's the thing with yaml

like image 110
Telen Avatar answered Sep 25 '22 10:09

Telen