MongoDB 安裝與配置

畢業(yè)設(shè)計采用 Python 寫電影個性化推薦,于是切換到Linux,安裝了Ubuntu 16.04。

數(shù)據(jù)儲存選用MongoDB,記一下安裝配置。

很多時候不必要找教程,官方指南能給予很好的指引。

安裝

基于ubuntu 16.04 & MongoDB 3.4

MongoDB官方網(wǎng)站 文檔頁面找到 Install MongoDB Community Edition on Ubuntu,按照其安裝方法進行安裝(懶得翻譯了...):

  1. Import the public key used by the package management system.
    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6

  2. Create a list file for MongoDB.(16.04)
    echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list

  3. Reload local package database.
    sudo apt-get update

  4. Install the MongoDB packages.
    sudo apt-get install -y mongodb-org

  5. run and stop.
    sudo service mongod start
    sudo service mongod stop

  6. Verify that MongoDB has started successfully
    Verify that the mongod process has started successfully by checking the contents of the log file at **/var/log/mongodb/mongod.log ** for a line reading
    [initandlisten] waiting for connections on port <port>
    where <port> is the port configured in /etc/mongod.conf, 27017 by default.

配置

待補充 現(xiàn)在暫時使用默認端口27017 無賬號密碼

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容