ps:如今最新版已經3.2了,可是數據庫是別人搭建的,用的是2.6html
下面咱們在CentOS 6.5 x64系統上安裝MongoDB 2.6.0版。mongodb
但在MongoDB v2.6.0版的軟件倉庫一共有五個包:shell
1)mongodb-org
此包是元數據包,它能夠實現自動安裝下面的4個組件包。
2)mongodb-org-server
此包裏面有mongod守護程序,以及相關的配置和初始化腳本。
3)mongodb-org-mongos
此包裏面有mongos守護程序。
4)mongodb-org-shell
此包裏面有mongo shell環境。
5)mongodb-org-tools
此包裏面有如下的MongoDB工具:mongoimport、bsondump、mongodump、mongoexport、mongofiles、mongoimport、mongooplog、mongoperf、mongorestore、mongostat以及mongotop。數據庫
控制腳本:mongodb-org包裏面有各類控制腳本,包括初始化腳本/etc/rc.d/init.d/mongod
使用/etc/mongod.conf配置文件來對MongoDB進行配置。工具
MongoDB 2.6.0版再也不有mongos的控制腳本。mongos進程只用於分片的場景。你能夠使用mongod初始化腳原本驅動mongos控制腳本。oop
要安裝最新的64位MongoDB 2.6.0版,步驟以下:post
一、建立mongodb.repo文件this
在/etc/yum.repos.d/目錄下建立文件mongodb.repo,它包含MongoDB倉庫的配置信息,內容以下:url
二、執行安裝命令
$ sudo yum install mongodb-org
Loaded plugins: security
base | 3.7 kB 00:00
base/primary_db | 4.4 MB 00:01
extras | 3.4 kB 00:00
extras/primary_db | 19 kB 00:00
mongodb | 951 B 00:00
mongodb/primary | 24 kB 00:16
mongodb 155/155
openlogic | 1.3 kB 00:00
openlogic/primary | 273 kB 00:00
openlogic 24/24
updates | 3.4 kB 00:00
updates/primary_db | 2.6 MB 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mongodb-org.x86_64 0:2.6.0-1 will be installed
--> Processing Dependency: mongodb-org-tools = 2.6.0 for package: mongodb-org-2.6.0-1.x86_64
--> Processing Dependency: mongodb-org-shell = 2.6.0 for package: mongodb-org-2.6.0-1.x86_64
--> Processing Dependency: mongodb-org-server = 2.6.0 for package: mongodb-org-2.6.0-1.x86_64
--> Processing Dependency: mongodb-org-mongos = 2.6.0 for package: mongodb-org-2.6.0-1.x86_64
--> Running transaction check
---> Package mongodb-org-mongos.x86_64 0:2.6.0-1 will be installed
---> Package mongodb-org-server.x86_64 0:2.6.0-1 will be installed
---> Package mongodb-org-shell.x86_64 0:2.6.0-1 will be installed
---> Package mongodb-org-tools.x86_64 0:2.6.0-1 will be installed
--> Finished Dependency Resolutionrest
Dependencies Resolved
============================================================================================
Package Arch Version Repository Size
============================================================================================
Installing:
mongodb-org x86_64 2.6.0-1 mongodb 4.6 k
Installing for dependencies:
mongodb-org-mongos x86_64 2.6.0-1 mongodb 6.8 M
mongodb-org-server x86_64 2.6.0-1 mongodb 8.9 M
mongodb-org-shell x86_64 2.6.0-1 mongodb 4.2 M
mongodb-org-tools x86_64 2.6.0-1 mongodb 88 M
Transaction Summary
============================================================================================
Install 5 Package(s)
Total download size: 108 MInstalled size: 274 MIs this ok [y/N]: y……