5

When I am using setParameter in mongod config, I start mongod with error:

Unrecognized option: setParameter = enableLocalhostAuthBypass=1

How can I use setParameter from config file ?

P/S: I am using YAML config file format.

7

Here's a working example that I just tested using 2.6.6 - I specified two parameters just to show how it is done for reference:

storage:
    dbPath: "/data/db/test"
systemLog:
    destination: file
    path: "/data/db/test/mongodb.log"
processManagement:
    fork: true
setParameter:
    enableLocalhostAuthBypass: 1
    enableTestCommands: 1
0
0

to set without mongod restart you can use like this example:

db.adminCommand( {
   setParameter: 1,
   logComponentVerbosity: {
      verbosity: 1,
      query: { verbosity: 2 },
      storage: {
         verbosity: 2,
         journal: {
            verbosity: 1
         }
      }
   }
} )
1
  • Does this update the configuration for the next restart, or does this simply change the parameter for the currently running mongod process?
    – RDFozz
    Mar 28 '18 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.