前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >MongoDB 基础(2)

MongoDB 基础(2)

作者头像
franket
发布2021-10-19 16:10:30
2090
发布2021-10-19 16:10:30
举报
文章被收录于专栏:技术杂记

安装软件

代码语言:javascript
复制
[root@h105 yum.repos.d]# yum clean all 
Loaded plugins: fastestmirror, refresh-packagekit, security
Repository base is listed more than once in the configuration
Cleaning repos: base epel extras mongodb-org-3.2 updates
Cleaning up Everything
Cleaning up list of fastest mirrors
[root@h105 yum.repos.d]# yum install -y mongodb-org
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Repository base is listed more than once in the configuration
Determining fastest mirrors
epel/metalink                                                                                                  | 3.3 kB
 * epel: mirror.pregi.net
 * extras: mirrors.aliyun.com
 * updates: mirrors.skyshe.cn
base                                                                                                           | 4.0 kB
base/primary_db                                                                                                | 4.5 MB
epel                                                                                                           | 4.3 kB
epel/primary_db                                                                                                | 5.9 MB
extras                                                                                                         | 3.4 kB
extras/primary_db                                                                                              |  37 kB
mongodb-org-3.2                                                                                                | 2.5 kB
mongodb-org-3.2/primary_db                                                                                     |  33 kB
updates                                                                                                        | 3.4 kB
updates/primary_db                                                                                             | 5.2 MB
Resolving Dependencies
--> Running transaction check
---> Package mongodb-org.x86_64 0:3.2.6-1.el6 will be installed
--> Processing Dependency: mongodb-org-tools = 3.2.6 for package: mongodb-org-3.2.6-1.el6.x86_64
--> Processing Dependency: mongodb-org-shell = 3.2.6 for package: mongodb-org-3.2.6-1.el6.x86_64
--> Processing Dependency: mongodb-org-server = 3.2.6 for package: mongodb-org-3.2.6-1.el6.x86_64
--> Processing Dependency: mongodb-org-mongos = 3.2.6 for package: mongodb-org-3.2.6-1.el6.x86_64
--> Running transaction check
---> Package mongodb-org-mongos.x86_64 0:3.2.6-1.el6 will be installed
---> Package mongodb-org-server.x86_64 0:3.2.6-1.el6 will be installed
---> Package mongodb-org-shell.x86_64 0:3.2.6-1.el6 will be installed
---> Package mongodb-org-tools.x86_64 0:3.2.6-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================================
 Package                              Arch                     Version                        Repository               
=======================================================================================================================
Installing:
 mongodb-org                          x86_64                   3.2.6-1.el6                    mongodb-org-3.2          
Installing for dependencies:
 mongodb-org-mongos                   x86_64                   3.2.6-1.el6                    mongodb-org-3.2          
 mongodb-org-server                   x86_64                   3.2.6-1.el6                    mongodb-org-3.2          
 mongodb-org-shell                    x86_64                   3.2.6-1.el6                    mongodb-org-3.2          
 mongodb-org-tools                    x86_64                   3.2.6-1.el6                    mongodb-org-3.2          

Transaction Summary
=======================================================================================================================
Install       5 Package(s)

Total download size: 65 M
Installed size: 206 M
Downloading Packages:
(1/5): mongodb-org-3.2.6-1.el6.x86_64.rpm                                                                      | 5.8 kB
(2/5): mongodb-org-mongos-3.2.6-1.el6.x86_64.rpm                                                               | 6.0 MB
(3/5): mongodb-org-server-3.2.6-1.el6.x86_64.rpm                                                               |  13 MB
(4/5): mongodb-org-shell-3.2.6-1.el6.x86_64.rpm                                                                | 7.3 MB
(5/5): mongodb-org-tools-3.2.6-1.el6.x86_64.rpm                                                                |  38 MB
-----------------------------------------------------------------------------------------------------------------------
Total                                                                                                 499 kB/s |  65 MB
warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID ea312927: NOKEY
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>"
 From  : https://www.mongodb.org/static/pgp/server-3.2.asc
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : mongodb-org-server-3.2.6-1.el6.x86_64                                                                   
  Installing : mongodb-org-mongos-3.2.6-1.el6.x86_64                                                                   
  Installing : mongodb-org-tools-3.2.6-1.el6.x86_64                                                                    
  Installing : mongodb-org-shell-3.2.6-1.el6.x86_64                                                                    
  Installing : mongodb-org-3.2.6-1.el6.x86_64                                                                          
  Verifying  : mongodb-org-shell-3.2.6-1.el6.x86_64                                                                    
  Verifying  : mongodb-org-tools-3.2.6-1.el6.x86_64                                                                    
  Verifying  : mongodb-org-mongos-3.2.6-1.el6.x86_64                                                                   
  Verifying  : mongodb-org-server-3.2.6-1.el6.x86_64                                                                   
  Verifying  : mongodb-org-3.2.6-1.el6.x86_64                                                                          

Installed:
  mongodb-org.x86_64 0:3.2.6-1.el6                                                                                     

Dependency Installed:
  mongodb-org-mongos.x86_64 0:3.2.6-1.el6     mongodb-org-server.x86_64 0:3.2.6-1.el6     mongodb-org-shell.x86_64 0:3.
  mongodb-org-tools.x86_64 0:3.2.6-1.el6     

Complete!
[root@h105 yum.repos.d]#
[root@h105 yum.repos.d]# mongo --version
MongoDB shell version: 3.2.6
[root@h105 yum.repos.d]# 

Tip: mongodb-org 其实本身不包含任何逻辑代码,只是利用 rpm 的 spec 文件在指定依赖,这样只用安装一个 mongodb-org ,yum 就会自动去将其依赖的 mongodb-org-mongos、mongodb-org-server、mongodb-org-shell、mongodb-org-tools 都给装上,简化了安装过程

Tip: 要查看这个包的依赖关系可以使用 yum deplist mongodb-org

Note: SELinux 可能妨碍 mongodb 的正常工作,要关掉

代码语言:javascript
复制
[root@h105 ~]# getenforce 
Disabled
[root@h105 ~]# grep -i '^SELINUX' /etc/sysconfig/selinux 
SELINUX=disabled
SELINUXTYPE=targeted 
[root@h105 ~]# 

本文系转载,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文系转载前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 安装软件
相关产品与服务
云数据库 MongoDB
腾讯云数据库 MongoDB(TencentDB for MongoDB)是腾讯云基于全球广受欢迎的 MongoDB 打造的高性能 NoSQL 数据库,100%完全兼容 MongoDB 协议,支持跨文档事务,提供稳定丰富的监控管理,弹性可扩展、自动容灾,适用于文档型数据库场景,您无需自建灾备体系及控制管理系统。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档