Unrecognized option: replication

While doing the lab I found this:

bash-4.4# mongod -f mongod_1.conf
Unrecognized option: replication
try ‘mongod --help’ for more information

My conf file has this:
storage:
dbPath: /var/mongodb/db/1
net:
bindIp: localhost
port: 27001
security:
authorization: enabled
keyFile: /var/mongodb/pki/m103-keyfile
systemLog:
destination: file
path: /var/mongodb/logs/mongod1.log
logAppend: true
processManagement:
fork: true
replication:
replSetName: m103-repl

–help says this:

bash-4.4# mongod --help | grep -i replica
Replication options:
–oplogSize arg size to use (in MB) for replication op
–master Master/slave replication no longer
–slave Master/slave replication no longer
Replica set options:
–replSet arg arg is [/<optionalseedhostlist

while starting mongod does not recognize the label replication. Help please to complete my training.

Hello,

Problem was indentation:

Solved by adding the proper one on replSetName, as follows:
replication:
replSetName: m103-repl

2 Likes