Mongodb in linux server

后端 未结 3 1723
借酒劲吻你
借酒劲吻你 2020-12-20 09:51

Using SSH I installed Mongodb in linux server by the following steps.

  1. Download and extract latest Mongodb release to the /bin folder in serer

相关标签:
3条回答
  • 2020-12-20 10:20

    I was having this error message after a clean install of mongodb.

    What worked for me was removing the lock file and starting mongodb again.

    Maybe see if that helps?

    Source:

    https://wiki.archlinux.org/index.php/MongoDB

    0 讨论(0)
  • 2020-12-20 10:23

    First of all, make sure your dbpath exists.

    mkdir -p ~/data/db
    

    Then start mongod with:

    mongod --dbpath ~/data/db
    

    Finally:

    mongo
    

    EDIT: I saw some people vote this answer up. To make it clear, this solution is for you to start mongod with command line. Most of the time if you installed MongoDB package from source, you can just start the daemon with:

    sudo systemctl start mongodb # Arch linux
    sudo service mongod start # CentOS/Redhat
    

    Configuration file can be found in:

    vim /etc/mongod.conf
    

    And if you want daemon to be auto started from boot,

    sudo systemctl enable mongodb # Arch Linux
    sudo chkconfig mongod on # CentOS/Redhat
    
    0 讨论(0)
  • 2020-12-20 10:23

    I had similar issue after copying all mongodb files form one server to another in

    /var/lib/mongodb/

    directory. Solution in my case was to change permission group to all files and folders in

    /var/lib/mongodb/

    to

    mongodb:nogroup

    0 讨论(0)
提交回复
热议问题