I could successfully complete the Lab: Logging to a Different Facility in the inbrowser IDE. However when I am trying this on my local system I am getting the error shown above. Any help is greatly appreciated.
My config file is as shown below:
I could successfully complete the Lab: Logging to a Different Facility in the inbrowser IDE. However when I am trying this on my local system I am getting the error shown above. Any help is greatly appreciated.
My config file is as shown below:
hi,
What happens if processManagemement.fork
are removed (both) ?
When I comment out those two lines in the config file and then run “mongod -f /opt/local/etc/mongodb/mongod.conf”, nothing happens. I just get the cursor back.
When I launch mongod with the default settings, it works. But when I am using the config file to launch, it is not working.
And is there anything in the logfile now?
No. The log file is not created when I try to launch with mongod -f /opt/local/etc/mongodb/mongod.conf
It says failed to unlink socket at /tmp/mongodb-27017.sock
you can remove that file, and test again.
Deleting the .sock file worked Thank you!
But still unable to launch mongod with the config file
No worries.
You may not have permissions to read or write from the directories you’re linking. Please check ls -l
on logPath and dbPath, they should exist or must be created.
So you can create the log path like so:
mkdir -p /var/log/mongodb/
The log file is created automatically.
You’ll probably get a new error, but try to do that first.
As Santiago_Miranda mentioned it is permissions issue
It is unable to create logile in /var/log/mongodb
I think it is owned by root
So you have to use sudo privs to allow mongod to write or choose a different logpath dir where you can write
If you run mongo
alone, and the server is running on port 27000
it will return an error, because the default is 27017
You need to run mongo --port 27000
What I was trying to get at is:
( What I normally do, is to create all folders under my home folder
/home/santi/mongo
and make sure to issue chown
to own the directories. Then you don’t need sudo. )
The process is tedious, but is very logical, you will be able to sort it out
Yes, I figured it out but couldn’t reply because of the restriction in the number of replies for a first time user.
Anyways thank you @Santiago_Miranda and @Ramachandra_37567 once again for all you help and patience! Yes, It is logical and quite clear now but I still don’t know why the --fork option is not working. Any ideas?
What is the new directory you wrote in the logPath ?
Does it exist (use ls
to check) ? Otherwise needs to be created, probably using sudo
.
The log path is getting created. and the --fork option is also working
Thank you once again @Santiago_Miranda
Alright, I’m happy too , but please take the time to read about permissions, and basic command line in Unix. It’s very very useful.
Yes, I did that yesterday. and planning to learn in detail now. I am new to DB administration, or any administration for that matter