关闭

yum安装最新版本的mongodb

3662人阅读 评论(1) 收藏 举报
分类:
准备安装最新版本的mongodb

操作系统版本  RHEL  6.7
Mongodb版本   mongodb server  3.2.6

1.第一步首先配置好本地的yum仓库和mongodb的官方yum源,本地yum仓库配置这里不再详述

#cd /etc/yum.repos.d
# more rhel-source.repo 
[rhel-source]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=file:///yum/Server
enabled=1
gpgcheck=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

###配置mongodb官方yum源

在/etc/yum.repos.d/增加mongodb-enterprise.repo文件

#vi /etc/yum.repos.d/mongodb-enterprise.repo

添加以下内容

[mongodb-enterprise]
name=MongoDB Enterprise Repository
baseurl=https://repo.mongodb.com/yum/redhat/$releasever/mongodb-enterprise/3.2/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc

执行以下命令,刷新yum仓库

#yum clean all
#yum update all
#yum list
         
(注:官方给的地址 baseurl=https://repo.mongodb.com/yum/redhat/$releasever/mongodb-enterprise/stable/$basearch/近期发现不再可用,但官方文档也没有对此进行更新,于是把stable替换成mongodb相应的版本3.2 或者最新的3.3版本

示例如下:  baseurl=https://repo.mongodb.com/yum/redhat/$releasever/mongodb-enterprise/3.2/$basearch/ 就可以正常用安装mongodb了)
         
         
2.安装依赖包在使用yum安装mongodb的时候,需要安装net-snmp和cyrus依赖包,否则会报以下缺少依赖包的错误,关于这两个依赖包没有做深入研究,只是mongodb依赖,那就装吧

Error: Package: mongodb-enterprise-server-3.2.6-1.el6.x86_64 (mongodb-enterprise) Requires: libnetsnmpmibs.so.20()(64bit)
Error: Package: mongodb-enterprise-shell-3.2.6-1.el6.x86_64 (mongodb-enterprise) Requires: cyrus-sasl-gssapi
Error: Package: mongodb-enterprise-server-3.2.6-1.el6.x86_64 (mongodb-enterprise) Requires: cyrus-sasl-gssapi
Error: Package: mongodb-enterprise-server-3.2.6-1.el6.x86_64 (mongodb-enterprise) Requires: net-snmp
Error: Package: mongodb-enterprise-tools-3.2.6-1.el6.x86_64 (mongodb-enterprise) Requires: cyrus-sasl-gssapi
Error: Package: mongodb-enterprise-server-3.2.6-1.el6.x86_64 (mongodb-enterprise) Requires: libnetsnmphelpers.so.20()(64bit)
Error: Package: mongodb-enterprise-server-3.2.6-1.el6.x86_64 (mongodb-enterprise) Requires: libnetsnmpagent.so.20()(64bit)
Error: Package: mongodb-enterprise-server-3.2.6-1.el6.x86_64 (mongodb-enterprise) Requires: libnetsnmp.so.20()(64bit)

3.安装net-snmp

# yum install -y net-snmp*
 
4.安装cyrus
 
# yum install  -y cyrus*
 
安装完成后检查依赖包是否安装成功
 
# rpm -qa | grep net-snmp
net-snmp-python-5.5-54.el6.x86_64
net-snmp-5.5-54.el6.x86_64
net-snmp-utils-5.5-54.el6.x86_64
net-snmp-devel-5.5-54.el6.x86_64
net-snmp-perl-5.5-54.el6.x86_64
net-snmp-libs-5.5-54.el6.x86_64


 
# rpm -qa | grep cyrus
cyrus-sasl-lib-2.1.23-15.el6_6.2.x86_64
cyrus-imapd-2.3.16-13.el6_6.x86_64
cyrus-sasl-2.1.23-15.el6_6.2.x86_64
cyrus-sasl-md5-2.1.23-15.el6_6.2.x86_64
cyrus-sasl-devel-2.1.23-15.el6_6.2.x86_64
cyrus-sasl-plain-2.1.23-15.el6_6.2.x86_64
cyrus-imapd-utils-2.3.16-13.el6_6.x86_64
cyrus-sasl-gssapi-2.1.23-15.el6_6.2.x86_64

到此,所有依赖包安装成功完成
 
5.安装mongodb sever 这里直接使用yum安装即可,如果不指定版本默认安装的是yum源配置的版本,本例配置的是3.2

# yum install -y mongodb-enterprise 
 
Loaded plugins: aliases, changelog, kabi, presto, product-id, refresh-packagekit, security, subscription-manager, tmprepo, verify, versionlock
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Loading support for Red Hat kernel ABI
Setting up Install Process
Repository rhel-source is listed more than once in the configuration
Resolving Dependencies
--> Running transaction check
---> Package mongodb-enterprise.x86_64 0:3.2.10-1.el6 will be installed
--> Processing Dependency: mongodb-enterprise-tools = 3.2.10 for package: mongodb-enterprise-3.2.10-1.el6.x86_64
--> Processing Dependency: mongodb-enterprise-shell = 3.2.10 for package: mongodb-enterprise-3.2.10-1.el6.x86_64
--> Processing Dependency: mongodb-enterprise-server = 3.2.10 for package: mongodb-enterprise-3.2.10-1.el6.x86_64
--> Processing Dependency: mongodb-enterprise-mongos = 3.2.10 for package: mongodb-enterprise-3.2.10-1.el6.x86_64
--> Running transaction check
---> Package mongodb-enterprise-mongos.x86_64 0:3.2.7-1.el6 will be updated
---> Package mongodb-enterprise-mongos.x86_64 0:3.2.10-1.el6 will be an update
---> Package mongodb-enterprise-server.x86_64 0:3.2.10-1.el6 will be installed
---> Package mongodb-enterprise-shell.x86_64 0:3.2.7-1.el6 will be updated
---> Package mongodb-enterprise-shell.x86_64 0:3.2.10-1.el6 will be an update
---> Package mongodb-enterprise-tools.x86_64 0:3.2.7-1.el6 will be updated
---> Package mongodb-enterprise-tools.x86_64 0:3.2.10-1.el6 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

=========================================================================================================
 Package                        Arch              Version             Repository                    Size
=========================================================================================================
Installing:
 mongodb-enterprise             x86_64            3.2.10-1.el6        mongodb-enterprise           5.9 k
Installing for dependencies:
 mongodb-enterprise-server      x86_64            3.2.10-1.el6        mongodb-enterprise            14 M
Updating for dependencies:
 mongodb-enterprise-mongos      x86_64            3.2.10-1.el6        mongodb-enterprise           6.1 M
 mongodb-enterprise-shell       x86_64            3.2.10-1.el6        mongodb-enterprise           7.9 M
 mongodb-enterprise-tools       x86_64            3.2.10-1.el6        mongodb-enterprise            44 M

Transaction Summary
=========================================================================================================
Install       2 Package(s)
Upgrade       3 Package(s)

Total size: 71 M
Total download size: 44 M
Downloading Packages:
Setting up and reading Presto delta metadata
Processing delta metadata
Package(s) data still to download: 44 M
mongodb-enterprise-tools-3.2.10-1.el6.x86_64.rpm                                |  44 MB     01:18     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : mongodb-enterprise-mongos-3.2.10-1.el6.x86_64                                       1/8 
  Updating   : mongodb-enterprise-tools-3.2.10-1.el6.x86_64                                        2/8 
  Installing : mongodb-enterprise-server-3.2.10-1.el6.x86_64                                       3/8 
  Updating   : mongodb-enterprise-shell-3.2.10-1.el6.x86_64                                        4/8 
  Installing : mongodb-enterprise-3.2.10-1.el6.x86_64                                              5/8 
  Cleanup    : mongodb-enterprise-mongos-3.2.7-1.el6.x86_64                                        6/8 
  Cleanup    : mongodb-enterprise-tools-3.2.7-1.el6.x86_64                                         7/8 
  Cleanup    : mongodb-enterprise-shell-3.2.7-1.el6.x86_64                                         8/8 
  Verifying  : mongodb-enterprise-shell-3.2.10-1.el6.x86_64                                        1/8 
  Verifying  : mongodb-enterprise-server-3.2.10-1.el6.x86_64                                       2/8 
  Verifying  : mongodb-enterprise-3.2.10-1.el6.x86_64                                              3/8 
  Verifying  : mongodb-enterprise-tools-3.2.10-1.el6.x86_64                                        4/8 
  Verifying  : mongodb-enterprise-mongos-3.2.10-1.el6.x86_64                                       5/8 
  Verifying  : mongodb-enterprise-shell-3.2.7-1.el6.x86_64                                         6/8 
  Verifying  : mongodb-enterprise-tools-3.2.7-1.el6.x86_64                                         7/8 
  Verifying  : mongodb-enterprise-mongos-3.2.7-1.el6.x86_64                                        8/8 

Installed:
  mongodb-enterprise.x86_64 0:3.2.10-1.el6                                                                                                                                                   

Dependency Installed:
  mongodb-enterprise-server.x86_64 0:3.2.10-1.el6                                                                                                                                            

Dependency Updated:
  mongodb-enterprise-mongos.x86_64 0:3.2.10-1.el6   
  mongodb-enterprise-shell.x86_64 0:3.2.10-1.el6                
  mongodb-enterprise-tools.x86_64 0:3.2.10-1.el6               

Complete!

  
到此mongodb 安装成功,整个安装过程还是非常简单的,开始启动mongodb

6.启动mongodb

# service  mongod start

Starting mongod: [  OK  ]

# ss -ln | grep 27017

LISTEN     0      128               127.0.0.1:27017                    *:*     

 已经正常监听27017端口了..

3
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:750397次
    • 积分:8482
    • 等级:
    • 排名:第2457名
    • 原创:132篇
    • 转载:45篇
    • 译文:9篇
    • 评论:43条
    简介
    此博客为笔者的DT工作记录,欢迎一起交流学习工作中的点滴,若博客文章观点存在原理的错误、纰漏,笔者非常欢迎各位不保留地指出
    最新评论