【阿里云镜像】配置阿里云镜像—MongoDB 镜像
2021-12-21 本文已影响0人
宝耶需努力
一、参考链接
🔴阿里巴巴开源镜像站-OPSX镜像站-阿里云开发者社区 (aliyun.com)
🟡mongodb镜像-mongodb下载地址-mongodb安装教程-阿里巴巴开源镜像站 (aliyun.com)
🟢centOs安装并使用mongodb 【国内镜像版】SWEENEY_HE的博客-CSDN博客mongodb国内镜像
二、MongoDB 镜像简介
MongoDB 是一个基于分布式文件存储的数据库。由 C++ 语言编写。旨在为 WEB 应用提供可扩展的高性能数据存储解决方案。
下载地址: https://mirrors.aliyun.com/mongodb/
三、MongoDB 镜像配置方法
1、配置CentOS系统的YUM源(基于Linux系统)
🔴查看系统版本信息
Kernel 3.10.0-1160.el7.x86_64 on an x86_64
centos login: root
Password:
Last login: Wed Dec 22 13:42:01 on tty1
[root@centos ~]# hostnamectl
Static hostname: centos
Icon name: computer-vm
Chassis: vm
Machine ID: f6fc8fb7991c4c518238af7c75f16046
Boot ID: 870af0bae5394857882a0baa5fa4c8e0
Virtualization: vmware
Operating System: CentOS Linux 7 (Core)
CPE OS Name: cpe:/o:centos:centos:7
Kernel: Linux 3.10.0-1160.el7.x86_64
Architecture: x86-64
[root@centos ~]#
🟠清除并更新YUM源
[root@centos ~]# yum clean all
[root@centos ~]# yum repolist</pre>
![image-20211221134849665](https://img.haomeiwen.com/i21120971/f8593800a66e94d2.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
🟡添加内容如下:(配置偶数版本,奇数版不适合生产使用)
在/etc/yum.repos.d创建一个mongodb-org.repo源文件
```sh
[root@centos ~]# vim /etc/yum.repos.d/mongodb-org.repo
[root@centos ~]# cat /etc/yum.repos.d/mongodb-org.repo
[mongodb-org]
name = MongoDB Repository
baseurl = https://mirrors.aliyun.com/mongodb/yum/redhat/$releasever/mongodb-org/3.6/x86_64/
gpgcheck = 1
enabled = 1
gpgkey = https://www.mongodb.org/static/pgp/server-3.6.asc
[root@centos ~]#
🟢清除缓存
执行yum makecache命令将服务器上的软件包信息显现在本地缓存,以提高搜索安装软件的速度
[root@centos ~]# yum makecache
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
base | 3.6 kB 00:00:00
epel | 4.7 kB 00:00:00 extras | 2.9 kB 00:00:00 mongodb-org | 2.5 kB 00:00:00 updates | 2.9 kB 00:00:00 Metadata Cache Created
[root@centos ~]#
2、安装 mongodb-org
[root@centos ~]# yum install mongodb-org
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package mongodb-org.x86_64 0:3.6.23-1.el7 will be installed
--> Processing Dependency: mongodb-org-mongos = 3.6.23 for package: mongodb-org-3.6.23-1.el7.x86_64
--> Processing Dependency: mongodb-org-server = 3.6.23 for package: mongodb-org-3.6.23-1.el7.x86_64
--> Processing Dependency: mongodb-org-shell = 3.6.23 for package: mongodb-org-3.6.23-1.el7.x86_64
--> Processing Dependency: mongodb-org-tools = 3.6.23 for package: mongodb-org-3.6.23-1.el7.x86_64
--> Running transaction check
---> Package mongodb-org-mongos.x86_64 0:3.6.23-1.el7 will be installed
---> Package mongodb-org-server.x86_64 0:3.6.23-1.el7 will be installed
---> Package mongodb-org-shell.x86_64 0:3.6.23-1.el7 will be installed
---> Package mongodb-org-tools.x86_64 0:3.6.23-1.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================================== Package Arch Version Repository Size
========================================================================================================================Installing:
mongodb-org x86_64 3.6.23-1.el7 mongodb-org 5.9 k
Installing for dependencies:
mongodb-org-mongos x86_64 3.6.23-1.el7 mongodb-org 12 M
mongodb-org-server x86_64 3.6.23-1.el7 mongodb-org 21 M
mongodb-org-shell x86_64 3.6.23-1.el7 mongodb-org 12 M
mongodb-org-tools x86_64 3.6.23-1.el7 mongodb-org 66 M
Transaction Summary
========================================================================================================================Install 1 Package (+4 Dependent packages)
Total download size: 111 M
Installed size: 292 M
Is this ok [y/d/N]: y
Downloading packages:
warning: /var/cache/yum/x86_64/7/mongodb-org/packages/mongodb-org-3.6.23-1.el7.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID 91fa4ad5: NOKEY
Public key for mongodb-org-3.6.23-1.el7.x86_64.rpm is not installed
(1/5): mongodb-org-3.6.23-1.el7.x86_64.rpm | 5.9 kB 00:00:00 (2/5): mongodb-org-mongos-3.6.23-1.el7.x86_64.rpm | 12 MB 00:00:17 (3/5): mongodb-org-shell-3.6.23-1.el7.x86_64.rpm | 12 MB 00:00:24 (4/5): mongodb-org-tools-3.6.23-1.el7.x86_64.rpm | 66 MB 00:01:19 (5/5): mongodb-org-server-3.6.23-1.el7.x86_64.rpm | 21 MB 00:02:16 ------------------------------------------------------------------------------------------------------------------------Total 824 kB/s | 111 MB 00:02:17 Retrieving key from https://www.mongodb.org/static/pgp/server-3.6.asc
Importing GPG key 0x91FA4AD5:
Userid : "MongoDB 3.6 Release Signing Key <packaging@mongodb.com>"
Fingerprint: 2930 adae 8caf 5059 ee73 bb4b 5871 2a22 91fa 4ad5
From : https://www.mongodb.org/static/pgp/server-3.6.asc
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : mongodb-org-server-3.6.23-1.el7.x86_64 1/5 Created symlink from /etc/systemd/system/multi-user.target.wants/mongod.service to /usr/lib/systemd/system/mongod.service.
Installing : mongodb-org-shell-3.6.23-1.el7.x86_64 2/5 Installing : mongodb-org-tools-3.6.23-1.el7.x86_64 3/5 Installing : mongodb-org-mongos-3.6.23-1.el7.x86_64 4/5 Installing : mongodb-org-3.6.23-1.el7.x86_64 5/5 Verifying : mongodb-org-mongos-3.6.23-1.el7.x86_64 1/5 Verifying : mongodb-org-tools-3.6.23-1.el7.x86_64 2/5 Verifying : mongodb-org-shell-3.6.23-1.el7.x86_64 3/5 Verifying : mongodb-org-3.6.23-1.el7.x86_64 4/5 Verifying : mongodb-org-server-3.6.23-1.el7.x86_64 5/5
Installed:
mongodb-org.x86_64 0:3.6.23-1.el7
Dependency Installed:
mongodb-org-mongos.x86_64 0:3.6.23-1.el7 mongodb-org-server.x86_64 0:3.6.23-1.el7
mongodb-org-shell.x86_64 0:3.6.23-1.el7 mongodb-org-tools.x86_64 0:3.6.23-1.el7
Complete!
[root@centos ~]#