mongodb在linux上的安裝-創(chuàng)新互聯(lián)

1、下載地址

創(chuàng)新互聯(lián)為您提適合企業(yè)的網(wǎng)站設(shè)計?讓您的網(wǎng)站在搜索引擎具有高度排名,讓您的網(wǎng)站具備超強的網(wǎng)絡(luò)競爭力!結(jié)合企業(yè)自身,進行網(wǎng)站設(shè)計及把握,最后結(jié)合企業(yè)文化和具體宗旨等,才能創(chuàng)作出一份性化解決方案。從網(wǎng)站策劃到網(wǎng)站設(shè)計制作、成都做網(wǎng)站, 我們的網(wǎng)頁設(shè)計師為您提供的解決方案。

http://www.mongodb.org/

2、安裝前準備

2.1、創(chuàng)建數(shù)據(jù)目錄和日志目錄

[root@gflinux4 mongodb]# mkdir -p/opt/mongo/{data,logs}

2.1、創(chuàng)建用戶和組

[root@gflinux mongodb]# useradd mongo

[root@gflinux mongodb]# groupadd mongo

groupadd: group mongo exists

2.3更改目錄屬組

[root@gflinux mongodb]# chown -Rmongo:mongo /opt/mongo/

[root@gflinux mongodb]# ll

total 112244

3、解壓

[root@gflinuxmongodb]# tar -zxvf mongodb-linux-i686-2.6.5.tgz

[root@gflinux mongodb]# cd mongodb-linux-i686-2.6.5

[root@gflinux mongodb-linux-i686-2.6.5]# ll

cdtotal 64

drwxr-xr-x 2 root root 4096 Oct 31 11:47 bin

-rw-r--r-- 1 root root 34520 Oct 8 00:13 GNU-AGPL-3.0

-rw-r--r-- 1 root root 1359 Oct 8 00:13 README

-rw-r--r-- 1 root root 17793 Oct 8 00:13 THIRD-PARTY-NOTICES

4、遷移數(shù)據(jù)至/usr/local/mongo目錄中

4.1拷貝文件至/usr/local/mongo

[root@gflinux4 mongodb]# cp -Rmongodb-linux-i686-2.6.5 /usr/local/mongo

[root@gflinux4 mongodb]# cd/usr/local/mongo/

[root@gflinux4 mongo]# ll

total 64

drwxr-xr-x 2 root root 4096 Dec 25 03:39 bin

-rw-r--r-- 1 root root 34520 Dec 25 03:39GNU-AGPL-3.0

-rw-r--r-- 1 root root 1359 Dec 25 03:39 README

-rw-r--r-- 1 root root 17793 Dec 25 03:39THIRD-PARTY-NOTICES

[root@gflinux4 mongo]# cd bin/

[root@gflinux4 bin]# ll

total 279652

-rwxr-xr-x 1 root root 23262756 Dec 2503:39 bsondump

-rwxr-xr-x 1 root root 11646208 Dec 2503:39 mongo

-rwxr-xr-x 1 root root 23425560 Dec 2503:39 mongod

-rwxr-xr-x 1 root root 23333956 Dec 2503:39 mongodump

-rwxr-xr-x 1 root root 23281924 Dec 2503:39 mongoexport

-rwxr-xr-x 1 root root 23326132 Dec 2503:39 mongofiles

-rwxr-xr-x 1 root root 23301860 Dec 2503:39 mongoimport

-rwxr-xr-x 1 root root 23272516 Dec 2503:39 mongooplog

-rwxr-xr-x 1 root root 23079220 Dec 2503:39 mongoperf

-rwxr-xr-x 1 root root 23371588 Dec 25 03:39mongorestore

-rwxr-xr-x 1 root root 18096080 Dec 2503:39 mongos

-rwxr-xr-x 1 root root 23321732 Dec 2503:39 mongostat

-rwxr-xr-x 1 root root 23265828 Dec 2503:39 mongotop

4.2、拷貝mongo、mongod到/usr/bin/中

[root@gflinux4 bin]# cp mongo /usr/bin/

[root@gflinux4 bin]# cp mongod /usr/bin/

5、初始化數(shù)據(jù)和日志目錄

[root@gflinux4 ~]# mongod --port 10001--dbpath /opt/mongo/data --logpath /opt/mongo/logs/mongodb.log

2014-12-25T03:45:35.518+0800

2014-12-25T03:45:35.519+0800 warning:32-bit servers don't have journaling enabled by default. Please use --journalif you want durability.

2014-12-25T03:45:35.520+0800

[root@gflinux4 data]# pwd

/opt/mongo/data

[root@gflinux4 data]# ll

total 82016

-rw------- 1 root root 67108864 Dec 2503:45 local.0

-rw------- 1 root root 16777216 Dec 2503:45 local.ns

-rwxr-xr-x 1 root root       6 Dec 25 03:45 mongod.lock

drwxr-xr-x 2 root root    4096 Dec 25 03:45 _tmp

[root@gflinux4 data]#

[root@gflinux4 logs]# pwd

/opt/mongo/logs

[root@gflinux4 logs]# ll

total 4

-rw-r--r-- 1 root root 2300 Dec 25 03:45mongodb.log

[root@gflinux4 logs]#

6、連接mongo

[root@gflinux4 logs]# mongo localhost:10001

MongoDB shell version: 2.6.5

connecting to: localhost:10001/test

Welcome to the MongoDB shell.

For interactive help, type"help".

For more comprehensive documentation, see

        http://docs.mongodb.org/

Questions? Try the support group

        http://groups.google.com/group/mongodb-user

Server has startup warnings:

2014-12-25T03:45:35.533+0800[initandlisten]

2014-12-25T03:45:35.533+0800[initandlisten] ** NOTE: This is a 32 bit MongoDB binary.

2014-12-25T03:45:35.533+0800[initandlisten] **      32 bit buildsare limited to less than 2GB of data (or less with --journal).

2014-12-25T03:45:35.534+0800[initandlisten] **      Note thatjournaling defaults to off for 32 bit and is currently off.

2014-12-25T03:45:35.534+0800[initandlisten] **      Seehttp://dochub.mongodb.org/core/32bit

2014-12-25T03:45:35.534+0800[initandlisten]

> db.foo.save({a:1})

WriteResult({ "nInserted" : 1 })

> db.foo.find();

{ "_id" :ObjectId("549b18ffff3a181677422f45"), "a" : 1 }

>

7、測試

http://192.168.88.101:10001/

It looks like you are trying to access MongoDBover HTTP on the native driver port.

8、客戶端連接

    使用MongoVUE連接。

另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。

新聞標題:mongodb在linux上的安裝-創(chuàng)新互聯(lián)
網(wǎng)頁鏈接:http://www.bm7419.com/article0/ihsoo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站策劃、網(wǎng)站維護、網(wǎng)站設(shè)計公司移動網(wǎng)站建設(shè)、營銷型網(wǎng)站建設(shè)電子商務(wù)

廣告

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

網(wǎng)站托管運營