HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

MongoDB -- Failed global initialization: Failed to open "var/log/mongodb/mongod.log"

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
vargloballogopenmongodbmongodfailedinitialization

Problem

I am getting errors starting Mongod v3.0.15 in Debian linux. I had changed the /etc/mongod.conf file to use smallFiles by adding mmapv1: smallFiles: true to the storage options.

I now get the following error when I execute $mongod --config /etc/mongod.conf:

ib1:/ 514 $ mongod --config /etc/mongod.conf

2017-10-03T12:14:21.183-0500 F CONTROL Failed global initialization: FileNotOpen Failed to open "/var/log/mongodb/mongod.log"

The mongod.log file exists, and it is also defined in the mongod.conf file as in that directory.

I am able to open the /var/log/mongodb/mongod.log file myself in the shell. It hasn't been written to in a long time (months) curiously.

Any ideas?

Thanks very much,
Karen

Solution

You may need to change the permissions for the parents directory /var/log/ as the user running the mongod instance might not have access to it. The below code should do it

sudo chmod 755 /var/log

Code Snippets

sudo chmod 755 /var/log

Context

StackExchange Database Administrators Q#187549, answer score: 3

Revisions (0)

No revisions yet.