標籤:
搜尋正面五個檔案,由於MongoDB的redhat國外鏡像訪問非常慢,下載安裝suse版本並安裝:
mongodb-org-2.6.6-1.i686.rpm
mongodb-org-mongos-2.6.6-1.i686.rpm
mongodb-org-server-2.6.6-1.i686.rpm
mongodb-org-shell-2.6.6-1.i686.rpm
mongodb-org-tools-2.6.6-1.i686.rpm
驗證環境變數是否生效:
$ mongod -version
db version v2.6.0
2014-04-14T02:53:01.082+0000 git version: 1c1c76aeca21c5983dc178920f5052c298db616c
運行MongoDB:
建立資料目錄
$ mkdir -p mongodb/data/db
要確保mongod對資料目錄有讀寫權限。
運行MongoDB(指定建立的資料目錄)
$ mongod --dbpath /home/chuser/mongodb/data &
6、驗證MongoDB是否正常運行
[[email protected] cache]# mongo
MongoDB shell version: 2.6.6
connecting to: test
Server has startup warnings:
2014-12-25T16:46:16.374+0800 [initandlisten]
2014-12-25T16:46:16.374+0800 [initandlisten] ** NOTE: This is a 32 bit MongoDB binary.
2014-12-25T16:46:16.374+0800 [initandlisten] ** 32 bit builds are limited to less than 2GB of data (or less with --journal).
2014-12-25T16:46:16.374+0800 [initandlisten] ** Note that journaling defaults to off for 32 bit and is currently off.
2014-12-25T16:46:16.374+0800 [initandlisten] ** See http://dochub.mongodb.org/core/32bit
2014-12-25T16:46:16.374+0800 [initandlisten]
> show databases;show databases;
admin (empty)
local 0.078GB
centos6.5安裝mongodb