@Ramachandra_Tummala has a nice point: more privilege issues.

in case you haven’t known:

  • almost all services in a unix-like system come with their respective user name and group (but without a home folder). this is to restrict the resources they have access to.
    • MongoDB services run with user:mongod and group:mongod
  • file/folder permissions can be read 4-0-0 which corresponds to owner-group-others. 400 means it can only be “read by owner”.
    • the file belongs to whoever owns the shell the editor (or file-creating command) starts.
  • chown and chgrp are used to change owner and group own files/folders, mostly by the root.

back to your problem. if it is this owner/group issue, then my suggested method to run as your user would “possibly” fail due to permissions to data folder and log file (or run just fine … permissions), but would definetely succesfuly run with root permissions (sudo). that is why it was/is important to run that command.

before moving on, change file permissions to 444 so it can be read by mongod, and try to run the service again. if it runs fine, you will know what to do: move file to a safe location, change user/group, change permission of both “the file and the folder it resides in”.