Results 1 to 3 of 3

Thread: Unable to chown MongoDB data folder

  1. #1

    Default Unable to chown MongoDB data folder

    Hello,

    Today I'm having trouble starting mongodb service on my machine. After reading the logs I found out it should be a permission issue on the mongodb data folder /var/lib/mongodb/.

    After some research I did the following command to change the owner of the /var/lib/mongodb foler:
    Code:
    $ sudo chown -cR mongodb:mongodb /var/lib/mongodb
    The result showed that the owner successfully changed to mongodb. But when I went to check the result, the owner remained unchanged:
    Code:
    $ sudo ls -ld /var/lib/mongodb/
    drwxr-xr-x 1 root root 0 May 24 11:43 /var/lib/mongodb/
    As you can see, the owner of this folder is still root, not mongodb. How is that possible? Is there any other way to do this? Please advise. Thank you.

  2. #2
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,378

    Default Re: Unable to chown MongoDB data folder

    Quote Originally Posted by rollschild View Post
    The result showed that the owner successfully changed to mongodb.
    How? You did not show that to us.

    Best is to copy/paste a little bit more so that it includes the prompt, the command, all output (even if it is nil) and the next prompt. That gives the maximum amount of information to the potential helpers here.
    Henk van Velden

  3. #3
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,461
    Blog Entries
    2

    Default Re: Unable to chown MongoDB data folder

    Also,
    You should post where you got your advice.

    I don't use mongodb so wouldn't know off the top of my head how mongodb is set up, but I imagine the permissions on the datafiles should be related to the security context the mongodb app itself is running in...

    In other words, if mongodb is set up to run using a mongodb service account, then it makes sense that the datafiles might need to have same security context.

    On the other hand, if mongodb is set up to run as a system service, then more than likely the data files should <not> be accessed using a mongodb account (although it's possible. Practically anything is configurable).

    I'd recommend you consult the most current MongoDB documentation available and specifically for your version of MongoDB... and be wary about random fixes you might find on the Internet.
    If you installed your MongoDB from openSUSE repos, typically everything should be set up with defaults that should work with official documentation and not require anything like changing permissions on data files.

    HTH,
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •