Lab : Configuration File

Hi all,

I’ve created the file config.cfg in shared folder.
This it the file:
storage:
dbPath: “/data/db”
systemLog:
path: “/data/mongod.log”
destination: “file”
net:
port : 27000
bindIp : “127.0.0.1, 192.168.0.10”
security:
authorization: “enabled”

Then I open vagrant up, vagrant, ssh
Then I execute this : mongod --config /shared/config.cfg

and I get this error:
log file “/data/mongod.log” exitst; moved to “/data/mongod.log.2019-05-17-T20-41-24”.

But nothing else occurss… so mongod doesn¡t start…

Thanks in advance for your help.

Xavi

I get the same message but it still starts, can you try confirming by attempting to connect to mongo? Also, I believe your bindIP is incorrect. The lab asks for different IP as compared with the lecture.

Hi Xavi,

I was also just having the same issue. I commented out lines regarding logPath and fork in my config file, then the results indicated that there was another mongod process running which is why it kept terminating the process I was trying to start.

In the previous lab, it was suggested to find the process id thats running using:

ps -ef | grep mongod

Then, when you find the process ID (mine was a four digit number) run:

kill pid

where pid is the process id you find

After I killed the process, I ran the mongod config command again and it worked.

Hope this helps!

1 Like

Hi Yousef,

Sorry but I newbie in linux…

Do I have to execute this inside vagrant or outside?

Thanks !!

XAVi

Missatge de Yousef Elmished Elmished via MongoDB University Discussion Forum mongodb_university@discoursemail.com del dia ds., 18 de maig 2019 a les 2:36:

And… could you please confirm me this config.cfg file is correct?

storage:

dbPath: “/data/db”

systemLog:

path: “/data/mongod.log”

destination: “file”

net:

port : 27000

bindIp : “127.0.0.1, 192.168.103.100”

security:

authorization: “enabled”

Best regards,

Xavi

Missatge de Yousef Elmished Elmished via MongoDB University Discussion Forum mongodb_university@discoursemail.com del dia ds., 18 de maig 2019 a les 2:36:

Hi Xavi,
Yes you have to run it in vagrant. Also, your config file looks close to mine but not exactly like mine. Here’s what my config file looks like:

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

Hello I’m Jessica,

I’m can’t configuration file, I already create a file mongod.cfg in the folder first_mongod, with permission 775, But when I Try the:

mongod --config /home/vagrant/first_mongod/mongod.cfg

I receive this error:

"about to fork child process, waiting until server is ready for connections.
forked process: 2118
ERROR: child process failed, exited with error number 48
To see additional information in this output, start without the “–fork” option.
"

How You doing this config file?
Help me please

Please try to run the command by removing --fork option
It will throw error on your terminal why it is failing
Mostly missing paths,permission issues etc

Also check your mongod.log for errors