一、安装环境及配置yum

# more /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)

# 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

1
    2
    3
    4
    5
    6
    7
    8
    9
    10

二、安装MongoDB

# yum -y install mongodb-org     
Loaded plugins: fastestmirror, langpacks                     
base                                                              | 3.6 kB  00:00:00     
epel/x86_64/metalink                                              | 5.2 kB  00:00:00     
extras                                                            | 3.4 kB  00:00:00     
mongodb-org-3.2                                                   | 2.5 kB  00:00:00     
updates                                                           | 3.4 kB  00:00:00     
mongodb-org-3.2/7/primary_db                                      |  50 kB  00:00:03     
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * epel: mirrors.tuna.tsinghua.edu.cn
 * extras: mirrors.aliyun.com
 * updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package mongodb-org.x86_64 0:3.2.10-1.el7 will be installed
--> Processing Dependency: mongodb-org-tools = 3.2.10 for package: mongodb-org-3.2.10-1.el7.x86_64
--> Processing Dependency: mongodb-org-shell = 3.2.10 for package: mongodb-org-3.2.10-1.el7.x86_64
--> Processing Dependency: mongodb-org-server = 3.2.10 for package: mongodb-org-3.2.10-1.el7.x86_64
--> Processing Dependency: mongodb-org-mongos = 3.2.10 for package: mongodb-org-3.2.10-1.el7.x86_64
--> Running transaction check
---> Package mongodb-org-mongos.x86_64 0:3.2.10-1.el7 will be installed
---> Package mongodb-org-server.x86_64 0:3.2.10-1.el7 will be installed
---> Package mongodb-org-shell.x86_64 0:3.2.10-1.el7 will be installed
---> Package mongodb-org-tools.x86_64 0:3.2.10-1.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================
 Package                                      Arch     Version             Repository         Size
===================================================================================================
Installing:
 mongodb-org                                  x86_64   3.2.10-1.el7        mongodb-org-3.2   5.8 k
Installing for dependencies:
 mongodb-org-mongos                           x86_64   3.2.10-1.el7        mongodb-org-3.2   5.6 M
 mongodb-org-server                           x86_64   3.2.10-1.el7        mongodb-org-3.2    12 M
 mongodb-org-shell                            x86_64   3.2.10-1.el7        mongodb-org-3.2   6.7 M
 mongodb-org-tools                            x86_64   3.2.10-1.el7        mongodb-org-3.2    41 M

Transaction Summary
===================================================================================================
Install  1 Package (+4 Dependent packages)

Total download size: 65 M
Installed size: 201 M
Downloading packages:
warning: /var/cache/yum/x86_64/7/mongodb-org-3.2/packages/mongodb-org-3.2.10-1.el7.x86_64.rpm:
        Header V3 RSA/SHA1 Signature, key ID ea312927: NOKEY  ]  
Public key for mongodb-org-3.2.10-1.el7.x86_64.rpm is not installed
(1/5): mongodb-org-3.2.10-1.el7.x86_64.rpm                                  | 5.8 kB  00:00:04     
(2/5): mongodb-org-server-3.2.10-1.el7.x86_64.rpm                           |  12 MB  00:00:11     
(3/5): mongodb-org-shell-3.2.10-1.el7.x86_64.rpm                            | 6.7 MB  00:00:06     
(4/5): mongodb-org-tools-3.2.10-1.el7.x86_64.rpm                            |  41 MB  00:00:36     
(5/5): mongodb-org-mongos-3.2.10-1.el7.x86_64.rpm                           | 5.6 MB  00:03:28     
---------------------------------------------------------------------------------------------------
Total                                                              322 kB/s |  65 MB  00:03:28     
Retrieving key from https://www.mongodb.org/static/pgp/server-3.2.asc
Importing GPG key 0xEA312927:
 Userid     : "MongoDB 3.2 Release Signing Key <packaging@mongodb.com>"
 Fingerprint: 42f3 e95a 2c4f 0827 9c49 60ad d68f a50f ea31 2927
 From       : https://www.mongodb.org/static/pgp/server-3.2.asc
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : mongodb-org-tools-3.2.10-1.el7.x86_64                                    1/5
  Installing : mongodb-org-mongos-3.2.10-1.el7.x86_64                                   2/5
  Installing : mongodb-org-shell-3.2.10-1.el7.x86_64                                    3/5
  Installing : mongodb-org-server-3.2.10-1.el7.x86_64                                   4/5
  Installing : mongodb-org-3.2.10-1.el7.x86_64                                          5/5
  Verifying  : mongodb-org-server-3.2.10-1.el7.x86_64                                   1/5
  Verifying  : mongodb-org-3.2.10-1.el7.x86_64                                          2/5
  Verifying  : mongodb-org-shell-3.2.10-1.el7.x86_64                                    3/5
  Verifying  : mongodb-org-mongos-3.2.10-1.el7.x86_64                                   4/5
  Verifying  : mongodb-org-tools-3.2.10-1.el7.x86_64                                    5/5

Installed:
  mongodb-org.x86_64 0:3.2.10-1.el7

Dependency Installed:
  mongodb-org-mongos.x86_64 0:3.2.10-1.el7      #Author : Leshami      
  mongodb-org-server.x86_64 0:3.2.10-1.el7      #Blog   : http://blog.csdn.net/leshami
  mongodb-org-shell.x86_64 0:3.2.10-1.el7           
  mongodb-org-tools.x86_64 0:3.2.10-1.el7

Complete!

1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87

三、验证安装结果

# rpm -qa |grep mongodb
mongodb-org-3.2.10-1.el7.x86_64
mongodb-org-mongos-3.2.10-1.el7.x86_64
mongodb-org-shell-3.2.10-1.el7.x86_64
mongodb-org-server-3.2.10-1.el7.x86_64
mongodb-org-tools-3.2.10-1.el7.x86_64

# rpm -ql mongodb-org-server
/etc/init.d/mongod
/etc/mongod.conf
/etc/sysconfig/mongod
/usr/bin/mongod
/usr/share/doc/mongodb-org-server-3.2.10
/usr/share/doc/mongodb-org-server-3.2.10/GNU-AGPL-3.0
/usr/share/doc/mongodb-org-server-3.2.10/MPL-2
/usr/share/doc/mongodb-org-server-3.2.10/README
/usr/share/doc/mongodb-org-server-3.2.10/THIRD-PARTY-NOTICES
/usr/share/man/man1/mongod.1
/var/lib/mongo
/var/log/mongodb
/var/log/mongodb/mongod.log
/var/run/mongodb

[root@localhost ~]# /etc/init.d/mongod start
Starting mongod (via systemctl):                           [  OK  ]
[root@localhost ~]# netstat -nltp|grep mongo
tcp        0      0 127.0.0.1:27017      0.0.0.0:*   LISTEN      89958/mongod

# mongo
MongoDB shell version: 3.2.10
connecting to: 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
> db.version()
4.0.5

CentOS 7 yum方式快速安装MongoDB的更多相关文章

  1. Linux - CentOS 7 yum方式快速安装MongoDB

    一.安装环境及配置yum # more /etc/redhat-release CentOS Linux release 7.2.1511 (Core) # vi /etc/yum.repos.d/m ...

  2. centos使用yum存储快速安装MySQL

    RHEL/CentOS 7.x MySQL yum库 https://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm RHEL ...

  3. 二进制方式快速安装MySQL数据库命令集合

    二进制方式快速安装MySQL数据库命令集合 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 1.安装mysql ls mysql ...

  4. 在Ubuntu上使用离线方式快速安装K8S v1.11.1

    在Ubuntu上使用离线方式快速安装K8S v1.11.1 0.安装包文件下载 https://pan.baidu.com/s/1nmC94Uh-lIl0slLFeA1-qw v1.11.1 文件大小 ...

  5. CentOS RDO方式快速安装OpenStack

    一.了解RDO RDO是什么? RDO是红帽Red Hat Enterprise Linux OpenStack Platform的社区版,类似RHEL和Fedora,RHEV和oVirt这样的关系. ...

  6. Centos中yum方式安装java

    查看CentOS自带JDK是否已安装.◆输入:yum list installed |grep java. 若有自带安装的JDK,如何卸载CentOS系统自带Java环境?◆卸载JDK相关文件输入:y ...

  7. Centos用yum方式安装nodejs和npm

    要通过 yum 来安装 nodejs 和 npm 需要先给 yum 添加 epel 源 ##添加 epel 源 rpm -ivh http://download.fedoraproject.org/p ...

  8. 用yum rpm 快速安装zabbix agent

    用yum 快速安装zabbix agent. wget http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-agent-3.4.2-1.el7 ...

  9. 通过YUM库自动安装Mongodb

    1.1查看操作系统版本 1.2验证当前yum库是否包含mongodb 1.3配置包含mongodb的yum源 1.4再次验证YUM库中的mongodb 1.5 yum库安装mongodb 为方便观察, ...

随机推荐

  1. CentOS配置history记录每个用户执行过的命令

    一个偶然的机会,看到了这个文档,先存下来,后续使用的话直接就加进去了 要记录登录者的用户名.IP.操作记录,在/etc/bashrc末尾加入几个环境变量,用于history命令显示用户ip等内容,完成 ...

  2. [BJOI2019] 光线

    看起来很麻烦,做起来并不难的题 以下设:$a_i=\frac{a_i}{100},b_i=\frac{b_i}{100}$ 显然,如果$b_i=0$的话,直接求$\Pi a_i$就是答案. 解决反射问 ...

  3. c++三种继承方式public,protect,private

    C++中的三种继承public,protected,private 三种访问权限 public:可以被任意实体访问 protected:只允许子类及本类的成员函数访问 private:只允许本类的成员 ...

  4. python中 yield的用法和生成器generator的说明

    详情: https://www.cnblogs.com/python-life/articles/4549996.html

  5. LeetCode刷题(Java)

    第一题 class Solution { public int[] twoSum(int[] nums, int target) { Map<Integer, Integer> map = ...

  6. [JDK8]性能优化之使用LongAdder替换AtomicLong

    如果让你实现一个计数器,有点经验的同学可以很快的想到使用AtomicInteger或者AtomicLong进行简单的封装. 因为计数器操作涉及到内存的可见性和线程之间的竞争,而Atomic***的实现 ...

  7. MessageFormat的用法,java动态替换String字符串中的占位符

    import java.text.MessageFormat; import java.util.GregorianCalendar; import java.util.Locale; public ...

  8. ES6 数组遍历方法的实战用法总结(forEach,every,some,map,filter,reduce,reduceRight,indexOf,lastIndexOf)

    目录 forEach every some map filter reduce && reduceRight indexOf lastIndexOf 前言 ES6原生语法中提供了非常多 ...

  9. oracle数据库驱动(ojdbc)

    第1部分 Q:为什么oralce的jdbc驱动,在maven上搜索到把pom配置复制到pom.xml里进行引用的时候会报错? ANS:虽然能在maven仓库里搜索到,但貌似不能用,原因是oracle是 ...

  10. Tupper自我指涉公式生成器