CentOS 安裝mongodb3.0 二進位包

來源:互聯網
上載者:User

環境:

centost6.5 x64

mongodb 3.0 1、到官網下載這個檔案:

mongodb-linux-x86_64-rhel62-3.0.0.gz

  2、安裝MongoDB(安裝到/usr/local)

 在/usr/local目錄下將安裝包解壓;

tar -zxvf mongodb-linux-x86_64-3.0.2.tgz

修改解壓後的目錄:

mv  mongodb-linux-x86_64-3.0.2  mongodb3.0.0

  3、在mongodb3.0.2目錄下的bin目錄中建立mongodb.conf檔案:

    dbpath=/home/mongodb-data/db         #資料檔案存放目錄,一般放在安裝檔案目錄下bin目錄中;    logpath=/home/mongodb-data/logs/mongodb.log      #記錄檔目錄,一般安裝目錄下bin目錄    port=27017                     #連接埠預設    fork=true                         # 以守護進程的方式運行MongoDB,建立伺服器處理序     nohttpinterface=true      # 關閉http介面,預設關閉27018連接埠訪問

 

重新綁定mongodb的設定檔地址和訪問IP:

 
/usr/local/mongodb3.0.0/bin/mongod --bind_ip localhost -f /usr/local/mongodb3.0.2/bin/mongodb.conf
 4.修改soft rlimits的限制

 vi /etc/security/limits.conf
在檔案最後加上

mongod  soft    nproc   65536mongod  hard    nproc   65536mongod  soft    nofile  65536mongod  hard    nofile  65536


5、啟動Mongo程式,使用設定檔mongodb.conf定義的參數啟動 

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

或則直接在/usr/local/mongodb3.0.2/bin/目錄下:

    ./mongod   --config  mongodb.conf

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.