Permission Errors While creating Replica Set

Hi I am getting this permission error while creating replica sets.

2018-12-10T13:11:17.358+0000 F CONTROL [main] Failed global initialization: FileNotOpen: Failed to open “/var/mongodb/db/mongod1.log”
vagrant@m103:~$ vi /var/mongodb/db/mongod1.log

Have created the key file successfully.

Regards

Diogo

The error message is about /var/…/mongod1.log, not about the key file. Could you share the output of ls -l /var/mongodb/db/mongod1.log?

Last login: Mon Dec 10 14:14:39 2018 from 10.0.2.2
vagrant@m103:~ ls -l /var/mongodb/db ls: cannot access /var/mongodb/db/3: Permission denied ls: cannot access /var/mongodb/db/mongod1.log: Permission denied ls: cannot access /var/mongodb/db/2: Permission denied ls: cannot access /var/mongodb/db/1: Permission denied ls: cannot access /var/mongodb/db/node1: Permission denied ls: cannot access /var/mongodb/db/mongod3.log: Permission denied ls: cannot access /var/mongodb/db/mongod2.log: Permission denied total 0 d????????? ? ? ? ? ? 1 d????????? ? ? ? ? ? 2 d????????? ? ? ? ? ? 3 -????????? ? ? ? ? ? mongod1.log -????????? ? ? ? ? ? mongod2.log -????????? ? ? ? ? ? mongod3.log d????????? ? ? ? ? ? node1 vagrant@m103:~ ls -l /var/mongodb/db/mongod1.log
ls: cannot access /var/mongodb/db/mongod1.log: Permission denied

In Chapter 1: The Mongod: Lab - Change the Default DB Path, please re-read the steps in paragraph Using what you know about the configuration file and Linux user groups, please complete the following:.

1 Like