Failed to open "/..../r0/mongodb.log"

Failed to open “/home/vagrant/M310-Hw-1.2/r0/mongodb.log”

cd ~/shared ./

db.shutdown secondaries then primary
(right now can’t connect direct to primary --port 31120)
check rs.status before shutting down primary and the secondaries looked shut down correctly

the keyfile was made in dir M310-HW-1.2 (and mod 400)
am attempting to restart primary with keyfile

there is mongodb.log.log in dir r0

running the mongod command using the logpath of the homework info:
–logpath ~/M310-Hw-1.2/r0/mongodb.log
and with variant:
–logpath ./M310-Hw-1.2/r0/mongodb.log

not using --fork at the moment

Unix is case sensitive
Hw is not same as HW
Also be clear of relative and absolute paths in Unix
Tilde(~) sign indicates home dir
–logpath ~/M310-Hw-1.2/r0/mongodb.log means /home/vagrant/M310-Hw-1.2/r0/mongodb.log

The second command
–logpath ./M310-Hw-1.2 means run from current dir

First time your mongods were brought up your setup script
Suggest you read this script and understand what dbpath/logpaths are used
Use those to frame your own commands and bring up manually mongods one by one

ah…Hw… should not work late in small font…

thanks for the ~ and . tutoring

if I understand: were I in dir M310-HW-1.2 when launching mongod then the logpath would be:
./r0/mongodb.log ? yes ?

Hi @James_58604,

The dot ( . ) is used when you need to run the script. for example when you run the validation script you run the following command in the terminal:

$ ./

In this case you can specify logpath as r0/mongodb.log

Please let me know, if you have any questions.