Mongodb在Ubuntu環境下的安裝(以mongodb3.2為例)

來源:互聯網
上載者:User

標籤:mongodb   nutch   監控雲   雲端運算   雲端服務   

軟體的下載這裡就不說了,最好是下載官方版本。。


//解壓

sudo tar -zxvf /usr/test/soft/mongodb-linux-x86_64-ubuntu1404-3.2.6.tgz -C /usr/test


//移動

sudo mv /usr/test/mongodb-linux-x86_64-ubuntu1404-3.2.6 /usr/test/mongodb3.2


//建立目錄

mkdir -p /usr/test/mongodb3.2/data/db    //db目錄

mkdir /usr/test/mongodb3.2/log       //存放日誌目錄


//新增/usr/test/mongodb3.2/mongod.conf設定檔,添加如下內容

dbpath=/usr/test/mongodb3.2/data/db
logpath=/usr/test/mongodb3.2/log/mongodb.log
logappend=true
fork=true


啟動mongodb
/usr/test/mongodb3.2/bin/mongod --config /usr/test/mongodb3.2/mongod.conf



//現在就可以進入mongodb 操作了 

進入mongodb
/usr/jiankongyun/mongodb3.2/bin/mongo
> show dbs

> use test

> show collections

> db.test.find()

> exit    


配置Mongodb自動啟動,編輯/etc/rc.local檔案,新增內容如下:
/usr/test/mongodb3.2/bin/mongod --config /usr/test/mongodb3.2/mongod.conf

 

   在這裡nutch+mongodb 資料的搭建 部署就完成了。。在Linux作業系統中操作時也會遇到這樣那樣的問題,只要沉下心來仔細查看錯誤提示  有日誌查看日誌,問題總能夠解決的。

 在這裡分享一個很不錯的網站,一個網路抓取的網站,監控雲 - 國內首家雲端式計算的互連網內容監控平台http://www.jiankongyun.met


Mongodb在Ubuntu環境下的安裝(以mongodb3.2為例)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.