Forking with config file

I am starting mongod with a config file. I have included the following in the config. When I start mongodb it does not fork, starts on port 27017 and gives a warning that auth has not been enabled. Any suggestions? Thanks.

processManagement:
fork : true

security:
authorization: “enabled”

net:
port: 27000

Fork, authorization and port should be indented as the config file is yaml.

2 Likes

And there’s a space before the colon (:).

When pasting logging, commands or configuration into your forum post, please use the </> button to make it a codeblock. That way you retain formatting and the forum won’t barf on particular special characters. Like so:

processManagement:
  fork : true

security:
  authorization: “enabled”

net:
  port: 27000

Hi Kurt_31421,

Please make sure your indentation is right and you pass the config file name to mongod command like this:

 mongod -f mongo_node1.conf

Also, I edited @Tess_Sluijter’s code, please use indentation carefully, I would suggest refer to MongoDB documentation: https://docs.mongodb.com/manual/reference/configuration-options/index.html

Kanika

Yes absolutely! My copy/paste example was to show what @Kurt_31421’s example would look like. It was not meant to be a good example :smiley:

1 Like