Can't connect after config file change

I did fine up until I changed the config file. But now I can’t even seem to start mongod or connect to it.
I have the /var/mongodb/db file structure.
Here’s my new config file:

Where and how to store data.

storage:
dbPath: “/var/mongodb/db/”
journal:
enabled: true

engine:

mmapv1:

wiredTiger:

where to write logging data.

systemLog:
destination: file
logAppend: true
path: C:\Program Files\MongoDB\Server\4.0\log\mongod.log

network interfaces

net:
port: 27000
bindIp: “192.168.103.100,localhost”

#processManagement:

#security:
security:
authorization: “enabled”

I issue the command:
vagrant@m103:~$ mongod -f /shared/mongod.cfg
and get back the vagrant prompt with no mongod startup info.
Then I issue the command:
mongo --port 27000 --username m103-admin --password m103-pass
and get back:
MongoDB shell version v3.6.12
connecting to: mongodb://127.0.0.1:27000/?gssapiServiceName=mongodb
2019-05-20T01:54:16.689+0000 W NETWORK [thread1] Failed to connect to 127.0.0.1:27000, in(checking socket for error after poll), reason: Connection refused
2019-05-20T01:54:16.740+0000 E QUERY [thread1] Error: couldn’t connect to server 127.0.0.1:27000, connection attempt failed :
connect@src/mongo/shell/mongo.js:263:13
@(connect):1:6
exception: connect failed
What’s the problem?

Hi @Bruce_02966,

Please share the screenshot of the config file, so I can check for any mistakes.

Thanks,
Sonali

What is the error message you are getting? I have a similar issue. I am using Notepad ++ in YAML mode. I saved the config file under the VMs “Shared” folder. This is the config.conf file I started with:

storage:
dbPath: /data/db/
systemLog:
destination: file
path: /data/db/mongod.log
net:
bindIp: 127.0.0.1,192.168.103.100
port: 27000
security:
authorization: enabled

I deliberately did not put in any quotes to show some of the weirdness I am experiencing. For the config file above, I get the following output:

vagrant@m103:~$ mongod --config /shared/config.conf
Unrecognized option: security

Now I then change the config file by adding in some quotes around “dbPath” and “path”:

storage:
dbPath: “/data/db/”
systemLog:
destination: file
path: “/data/db/mongod.log”
net:
bindIp: 127.0.0.1,192.168.103.100
port: 27000
security:
authorization: enabled

I now get this message:

vagrant@m103:~$ mongod --config /shared/config.conf
Unrecognized option: security

I go a little further now and add quotes to “bindIp”,

storage:
dbPath: “/data/db/”
systemLog:
destination: file
path: “/data/db/mongod.log”
net:
bindIp: “127.0.0.1,192.168.103.100”
port: 27000
security:
authorization: enabled

I now get this error:

vagrant@m103:~$ mongod --config /shared/config.conf
Unrecognized option: systemLog

I tried to add quotes around “file” and got the same error. I then did some editing of the positioning and spacing and it finally worked using the following, please note that on the last attempt all I did was add in line breaks and added in one space to each of the sub-content of each header.

#################################################

storage:
 dbPath: “/data/db/”

systemLog:
  destination: “file”
  path: “/data/db/mongod.log”

net:
  bindIp: “127.0.0.1,192.168.103.100”
  port: 27000

security:
  authorization: enabled

#################################################

output was:

vagrant@m103:~$ mongod --config /shared/config.conf
2019-05-20T21:01:27.494+0000 I CONTROL [main] log file “/data/db/mongod.log” exists; moved to “/data/db/mongod.log.2019-05-20T21-01-27”.

That’s only an information message.

In Chapter 1: The Mongod Lab - Configuration File, there was a link about YAML format. By following the link you would have found quite quickly the need for the indentation.

All it says is “YAML does not support tab characters for indentation: use spaces instead.” but it doesn’t mention anywhere that it explicitly needs them in order to work. That is from the following link. https://docs.mongodb.com/manual/reference/configuration-options/

If you are referring to the YAML link within that document, its just a link to the entire YAML specification, that should not be required reading.

You are right it does not mention anywhere that it explicitly needs them in order to work. But every single examples that follows show spaces.