MongoDB - Permission denied for socket: /tmp/mongodb-27017.sock

后端 未结 6 500
隐瞒了意图╮
隐瞒了意图╮ 2020-12-03 07:41

I had an unclean shutdown of MongoDB on Ubuntu 10.04 LTS. Now when I login as root and run Mongodb via service mongodb start, I get below error-

Mon Dec 12          


        
6条回答
  •  鱼传尺愫
    2020-12-03 07:55

    In the Versions before 3.0 the socket was created with 777 permissions by default. Most the most correct way set permissions to mongod socket is set value in mongodb.conf. For example:

    sudo vim /usr/local/etc/mongodb.conf
    

    and insert line:

    filePermissions = 0777 
    

    to it.

    In case if you will try directly change permissions to /tmp/mongodb-27017.sock with chown and chmod you can have a chance set it temporary. And have a old permissions after mongod service restart or server reboot.

提交回复
热议问题