Replica Set Deployment "This node was not started with the replSet option"


I got a problem with the Deployment of my Replica Set.
My mongod_1 file looks as follows:
dbPath: /var/mongodb/db/node1
bindIp: localhost
port: 27001
authorization: enabled
keyFile: /var/mongodb/pki/m103-keyfile
destination: file
path: /var/mongodb/logs/mongod1.log
logAppend: true
#fork: true
replSetName: m103-example

I essentially followed the procedure described in the preceding lecture “setting up a replica set”. I created the keyfile, changed ownership, created all the directories. After I ran “mongod -f mongod_1.conf” then “mongo --port 27001” and successfully connected to the database, I always run into an error when I try running “rs.initiate()”.

I always get the following error message:

“ok” : 0,
“errmsg” : “This node was not started with the replSet option”,
“code” : 76,
“codeName” : “NoReplicationEnabled”

I can’t explain this, because I thought that I added the replSet option by adding the replSetName to the config file. (I ran mongod after I changed the config file). When I uncomment the fork:true I get following error “about to fork child process, waiting until server is ready for connections.
forked process: 446
ERROR: child process failed, exited with error number 48
To see additional information in this output, start without the “–fork” option.” but this shouldn’t affect the replica set or am I wrong? If so, how would I go about solving this issue.

Thank you!


Do you have another mongod instance running on the same port?
If yes kill that and try again

1 Like