• Centos7下快速安装Mongo3.2


    Centos7下快速安装Mongo3.2

    **一般安装Mongo推荐源码安装,有时候为了快部署测试环境,或者仅仅是想装个mongo shell,这时候yum安装是最合适的方式,
    下面介绍一下如何在Centos 7 下用yum的方式快速安装Mongo。
    **

    MongoDB 3.2 一共有五个包:
    mongodb-org-3.2.10-1.el7.x86_64.rpm         #元数据包 上面记录下以下4个包的依赖关系                           
    mongodb-org-server-3.2.10-1.el7.x86_64.rpm  #mongod服务端程序,以及相关的配置和初始化脚本。                          
    mongodb-org-shell-3.2.10-1.el7.x86_64.rpm   #mongo shell 客户端环境                           
    mongodb-org-tools-3.2.10-1.el7.x86_64.rpm   #最大的一个包,有关Mongo的工具:包括 mongoimport mongostat等                          
    mongodb-org-mongos-3.2.10-1.el7.x86_64.rpm  #mongos程序 用来分片的路由                     
    

    1.配置yum源

    vi /etc/yum.repos.d/mongodb-org-3.2.repo
    [mongodb-org-3.2] 
    name=MongoDB Repository 
    baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/
    gpgcheck=1 
    enabled=1 
    gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc
    

    2.yum 安装 MongoDB

    yum -y install mongodb-org 
    
    #我这里只安装mogno shell
    [root@localhost scripts]# yum install mongodb-org-shell
    已加载插件:fastestmirror, langpacks
    Loading mirror speeds from cached hostfile
     * base: mirrors.sohu.com
     * extras: mirrors.sohu.com
     * updates: mirrors.sohu.com
    正在解决依赖关系
    --> 正在检查事务
    ---> 软件包 mongodb-org-shell.x86_64.0.3.2.16-1.el7 将被 安装
    --> 解决依赖关系完成
    
    依赖关系解决
    
    =============================================================================================================================
     Package   架构   版本 源   大小
    =============================================================================================================================
    正在安装:
     mongodb-org-shell x86_64 3.2.16-1.el7 mongodb-org-3.2 6.8 M
    
    事务概要
    =============================================================================================================================
    安装  1 软件包
    
    总下载量:6.8 M
    安装大小:20 M
    Is this ok [y/d/N]: y
    Downloading packages:
    No Presto metadata available for mongodb-org-3.2
    警告:/var/cache/yum/x86_64/7/mongodb-org-3.2/packages/mongodb-org-shell-3.2.16-1.el7.x86_64.rpm: 头V3 RSA/SHA1 Signature, 密钥 ID ea312927: NOKEY
    mongodb-org-shell-3.2.16-1.el7.x86_64.rpm 的公钥尚未安装
    mongodb-org-shell-3.2.16-1.el7.x86_64.rpm | 6.8 MB  00:02:15 
    从 https://www.mongodb.org/static/pgp/server-3.2.asc 检索密钥
    导入 GPG key 0xEA312927:
     用户ID : "MongoDB 3.2 Release Signing Key <packaging@mongodb.com>"
     指纹   : 42f3 e95a 2c4f 0827 9c49 60ad d68f a50f ea31 2927
     来自   : https://www.mongodb.org/static/pgp/server-3.2.asc
    是否继续?[y/N]:y
    Running transaction check
    Running transaction test
    Transaction test succeeded
    Running transaction
      正在安装: mongodb-org-shell-3.2.16-1.el7.x86_641/1 
      验证中  : mongodb-org-shell-3.2.16-1.el7.x86_641/1 
    
    已安装:
      mongodb-org-shell.x86_64 0:3.2.16-1.el7
    
    完毕!
    

    3.验证安装

    [root@localhost scripts]# mongo --host xx.x.xxx.xxx
    MongoDB shell version: 3.2.16
    connecting to: xx.x.xxx.xxx:27017/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-Sent Events(SSE) 简单实现和避坑
    使用ZIP进行多文件保存和读取(JDK1.7之后ZipOutputStream已经支持中文)
    IO
    页面临时添加a元素来模拟上传下载
    Centos 7启动jar包的详细步骤
    Redis 下载地址
    永久关闭win10自动更新
    同一命名空间下,无法引用类时
    Web应用程序项目******已配置为使用IIS。未能找到Web服务器
    VS2012打开项目 提示Asp.net4.0未在web服务器上注册的解决方案
  • 原文地址:https://www.cnblogs.com/chinesern/p/7423464.html
Copyright © 2020-2023  润新知