Ubuntu下mongodb的安裝方法

本篇內(nèi)容介紹了“Ubuntu下MongoDB的安裝方法”的有關(guān)知識,在實(shí)際案例的操作過程中,不少人都會遇到這樣的困境,接下來就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!

創(chuàng)新互聯(lián)主營政和網(wǎng)站建設(shè)的網(wǎng)絡(luò)公司,主營網(wǎng)站建設(shè)方案,手機(jī)APP定制開發(fā),政和h5小程序開發(fā)搭建,政和網(wǎng)站營銷推廣歡迎政和等地區(qū)企業(yè)咨詢

  1. 下載mongodb源碼,并解壓:

    wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-4.0.11.tgz
    
    tar -zxvf mongodb-linux-x86_64-ubuntu1604-4.0.11.tgz

     

  2. 創(chuàng)建mongo專屬目錄,拷貝bin下文件到mongodb目錄下bin中:

    mkdir /usr/local/mongodb
    
    cd /usr/local/mongodb
    
    mkdir bin
    
    cp .../mongodb-linux-x86_64-ubuntu1604-4.0.11/bin/* ./bin/

     

  3. 創(chuàng)建數(shù)據(jù)庫文件目錄、日志目錄、配置文件:

    mkdir data
    
    touch mongodb.log
    
    touch mongodb.conf

     

  4. 配置文件內(nèi)容:

    dbpath=/usr/local/mongodb/data
    logpath=/usr/local/mongodb/mongodb.log
    
    logappend=true
    journal=true
    fork=true
    
    bind_ip = 127.0.0.1
    port = 27017
    
    noauth = true
    #auth = true

     

  5. 將mongo添加path:

    #打開profile
    vi /etc/profile
    
    #輸入下面內(nèi)容:
    MONGO_DB="/usr/local/mongodb"
    PATH=$MONGO_DB/bin:$PATH:
    export PATH
    
    #加載配置
    source /etc/profile

     

  6. 啟動mongodb:

    /usr/local/mongodb/bin/mongod --config /usr/local/mongodb/mongodb.conf

     

    #啟動后會看到:
    
    about to fork child process, waiting until server is ready for connections.
    forked process: 1361
    child process started successfully, parent exiting

     

“Ubuntu下mongodb的安裝方法”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!

分享文章:Ubuntu下mongodb的安裝方法
網(wǎng)站鏈接:http://www.muchs.cn/article42/gdgshc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)建站、服務(wù)器托管、微信小程序網(wǎng)站營銷、網(wǎng)站維護(hù)、響應(yīng)式網(wǎng)站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

網(wǎng)站托管運(yùn)營