Reputation: 879
I'm trying to start MongoDB on windows 10, by specifying the config file. The config file specifies the path to the database. When I run the mongodb daemon:
.\mongod.exe --config .\mongod.cfg
I get this error:
{"t":{"$date":"2021-01-24T00:15:15.541Z"},"s":"F", "c":"CONTROL", "id":20574, "ctx":"main","msg":"Error during global initialization","attr":{"error":{"code":38,"codeName":"FileNotOpen","errmsg":"Failed to open C:\\Program Files\\MongoDB\\Server\\4.4\\log\\mongod.log"}}}
It complains that it can't access the log file. However I have verified that the log file exists in the location that it's complaining about:
ls "C:\\Program Files\\MongoDB\\Server\\4.4\\log\\mongod.log"
Directory: C:\Program Files\MongoDB\Server\4.4\log
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 1/23/2021 6:56 PM 100428 mongod.log
This is my mongod config:
# mongod.conf
# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/
# Where and how to store data.
storage:
dbPath: C:\Program Files\MongoDB\Server\4.4\data
journal:
enabled: true
# engine:
# mmapv1:
# wiredTiger:
# where to write logging data.
systemLog:
destination: file
logAppend: true
path: C:\Program Files\MongoDB\Server\4.4\log\mongod.log
# network interfaces
net:
port: 27017
bindIp: 127.0.0.1
#processManagement:
#security:
#operationProfiling:
#replication:
#sharding:
## Enterprise-Only Options:
#auditLog:
#snmp:
How can I get this party started?
Upvotes: 1
Views: 2511
Reputation: 10707
in "properties" of the log file, open "Security" and put permission to "write"
Upvotes: 3