根据课程视频的讲解,在安装Mongodb之前需要执行以下操作:
vi /etc/yum.repos.d/10gen.repo,输入下面的语句:
[10gen]
name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
但是我认为我的CentOS6.5是32位的,因此将 baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64改为baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686
并且进入查看是否存在mongo-10gen-server可供下载,下图可见是存在的:
但是执行yum info mongo-10gen-server的时候还是搜索失败:
看到repomd.xml is older的提示,怀疑是不是有什么缓存信息没有被更新,查了一下帖子,然后执行如下操作:
cd /var/cache/yum
rm -rf *
再重新搜索mongo-10gen-server就成功了:
然后开始安装:
[root@nathan-CentOS6 yum]# yum install mongo-10gen-server
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirror.bit.edu.cn
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mongo-10gen-server.i686 0:2.4.9-mongodb_1 will be installed
--> Processing Dependency: mongo-10gen for package: mongo-10gen-server-2.4.9-mongodb_1.i686
--> Running transaction check
---> Package mongo-10gen.i686 0:2.4.9-mongodb_1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================
Installing:
mongo-10gen-server i686 2.4.9-mongodb_1 10gen 12 M
Installing for dependencies:
mongo-10gen i686 2.4.9-mongodb_1 10gen 71 M
Transaction Summary
=================================================================================================================================================
Install 2 Package(s)
Total download size: 83 M
Installed size: 211 M
Is this ok [y/N]: y
Downloading Packages:
http://downloads-distro.mongodb.org/repo/redhat/os/i686/RPMS/mongo-10gen-2.4.9-mongodb_1.i686.rpm: [Errno 14] PYCURL ERROR 7 - "couldn't connect to host"
Trying other mirror.
........
vi /etc/yum.repos.d/10gen.repo,输入下面的语句:
[10gen]
name=10gen Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64
gpgcheck=0
但是我认为我的CentOS6.5是32位的,因此将 baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64改为baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/i686
![](http://img.blog.itpub.net/blog/attachment/201402/21/26521853_1392962578G64B.jpg?x-oss-process=style/bb)
并且进入查看是否存在mongo-10gen-server可供下载,下图可见是存在的:
![](http://img.blog.itpub.net/blog/attachment/201402/21/26521853_1392962548d6Pw.jpg?x-oss-process=style/bb)
但是执行yum info mongo-10gen-server的时候还是搜索失败:
![](http://img.blog.itpub.net/blog/attachment/201402/21/26521853_1392962738365F.jpg?x-oss-process=style/bb)
看到repomd.xml is older的提示,怀疑是不是有什么缓存信息没有被更新,查了一下帖子,然后执行如下操作:
cd /var/cache/yum
rm -rf *
再重新搜索mongo-10gen-server就成功了:
![](http://img.blog.itpub.net/blog/attachment/201402/21/26521853_1392962883G50c.jpg?x-oss-process=style/bb)
然后开始安装:
[root@nathan-CentOS6 yum]# yum install mongo-10gen-server
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirror.bit.edu.cn
* extras: mirror.bit.edu.cn
* updates: mirror.bit.edu.cn
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package mongo-10gen-server.i686 0:2.4.9-mongodb_1 will be installed
--> Processing Dependency: mongo-10gen for package: mongo-10gen-server-2.4.9-mongodb_1.i686
--> Running transaction check
---> Package mongo-10gen.i686 0:2.4.9-mongodb_1 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=================================================================================================================================================
Package Arch Version Repository Size
=================================================================================================================================================
Installing:
mongo-10gen-server i686 2.4.9-mongodb_1 10gen 12 M
Installing for dependencies:
mongo-10gen i686 2.4.9-mongodb_1 10gen 71 M
Transaction Summary
=================================================================================================================================================
Install 2 Package(s)
Total download size: 83 M
Installed size: 211 M
Is this ok [y/N]: y
Downloading Packages:
http://downloads-distro.mongodb.org/repo/redhat/os/i686/RPMS/mongo-10gen-2.4.9-mongodb_1.i686.rpm: [Errno 14] PYCURL ERROR 7 - "couldn't connect to host"
Trying other mirror.
........
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26521853/viewspace-1085542/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26521853/viewspace-1085542/