安装 MongoDB
MongoDB 提供两种服务器版本:社区版和企业版。
本手册的这一部分包含有关安装 MongoDB 的信息。
有关将当前部署升级到 MongoDB 8.0 的说明,请参阅 8.0 升级过程。
有关升级到当前版本的最新补丁版本的说明,请参阅升级到 MongoDB 的最新自管理补丁版本。
有关
mongod
、mongos
以及与 MongoDB 一起发布的所有其他工具的文档,请参阅 MongoDB 包组件。
MongoDB 安装教程
可在以下平台应用 MongoDB 的安装教程,包括 MongoDB Community Edition 和Enterprise Edition:
平台 | Community Edition | 企业版 |
---|---|---|
Linux | ||
macOS | ||
Windows | ||
Docker |
升级 Community Edition 到 Enterprise Edition 的教程
重要
请勿使用这些说明升级到其他发布版本。如需升级发布版本,请参阅相应的版本升级说明,如升级到 MongoDB 8.0。
支持的平台
重要
MongoDB 不支持 32 位 x86 平台。
重要
v4.4 生命周期结束
V4.4 已于 2024 年 2 月 29 日到期,MongoDB 不再提供支持。
平台 | 架构 | 版本 | 8.0 | 7.0 | 6.0 | 5.0 | 4.4 |
---|---|---|---|---|---|---|---|
Amazon Linux 2023 | x86_64 | Enterprise | ✓ | ✓ | |||
Amazon Linux 2023 | x86_64 | Community | ✓ | ✓ | |||
Amazon Linux V2 | x86_64 | Enterprise | ✓ | ✓ | ✓ | ✓ | |
Amazon Linux V2 | x86_64 | Community | ✓ | ✓ | ✓ | ✓ | |
Debian 12 | x86_64 | Enterprise | ✓ | ✓ | |||
Debian 12 | x86_64 | Community | ✓ | ✓ | |||
Debian 11 | x86_64 | Enterprise | ✓ | ✓ | 5.0.8+ | ||
Debian 11 | x86_64 | Community | ✓ | ✓ | 5.0.8+ | ||
Debian 10 | x86_64 | Enterprise | ✓ | ✓ | ✓ | ||
Debian 10 | x86_64 | Community | ✓ | ✓ | ✓ | ||
Debian 9 | x86_64 | Enterprise | ✓ | ✓ | |||
Debian 9 | x86_64 | Community | ✓ | ✓ | |||
RHEL/Rocky/Alma/Oracle Linux 9.0+ [1] | x86_64 | Enterprise | ✓ | ✓ | 6.0.4+ | ||
RHEL/Rocky/Alma/Oracle Linux 9.0+ [1] | x86_64 | Community | ✓ | ✓ | 6.0.4+ | ||
RHEL/Rocky/Alma/Oracle Linux 8.0+ [1] | x86_64 | Enterprise | ✓ | ✓ | ✓ | ✓ | ✓ |
RHEL/Rocky/Alma/Oracle Linux 8.0+ [1] | x86_64 | Community | ✓ | ✓ | ✓ | ✓ | ✓ |
RHEL/CentOS/Oracle Linux 7.0+ [1] | x86_64 | Enterprise | ✓ | ✓ | ✓ | ✓ | |
RHEL/CentOS/Oracle Linux 7.0+ [1] | x86_64 | Community | ✓ | ✓ | ✓ | ✓ | |
RHEL/CentOS/Oracle Linux 6.2+ [1] | x86_64 | Enterprise | ✓ | ||||
RHEL/CentOS/Oracle Linux 6.2+ [1] | x86_64 | Community | ✓ | ||||
SLES 15 | x86_64 | Enterprise | ✓ | ✓ | ✓ | ✓ | ✓ |
SLES 15 | x86_64 | Community | ✓ | ✓ | ✓ | ✓ | ✓ |
SLES 12 | x86_64 | Enterprise | ✓ | ✓ | ✓ | ✓ | |
SLES 12 | x86_64 | Community | ✓ | ✓ | ✓ | ✓ | |
Ubuntu 24.04 | x86_64 | Enterprise | ✓ | ||||
Ubuntu 24.04 | x86_64 | Community | ✓ | ||||
Ubuntu 22.04 | x86_64 | Enterprise | ✓ | ✓ | 6.0.4+ | ||
Ubuntu 22.04 | x86_64 | Community | ✓ | ✓ | 6.0.4+ | ||
Ubuntu 20.04 | x86_64 | Enterprise | ✓ | ✓ | ✓ | ✓ | ✓ |
Ubuntu 20.04 | x86_64 | Community | ✓ | ✓ | ✓ | ✓ | ✓ |
Ubuntu 18.04 | x86_64 | Enterprise | ✓ | ✓ | ✓ | ||
Ubuntu 18.04 | x86_64 | Community | ✓ | ✓ | ✓ | ||
Ubuntu 16.04 | x86_64 | Enterprise | ✓ | ||||
Ubuntu 16.04 | x86_64 | Community | ✓ | ||||
Windows 11 | x86_64 | Enterprise | ✓ | ✓ | ✓ | ||
Windows 11 | x86_64 | Community | ✓ | ✓ | ✓ | ||
Windows Server 2022 | x86_64 | Enterprise | ✓ | ✓ | ✓ | ||
Windows Server 2022 | x86_64 | Community | ✓ | ✓ | ✓ | ||
Windows Server 2019 | x86_64 | Enterprise | ✓ | ✓ | ✓ | ✓ | |
Windows Server 2019 | x86_64 | Community | ✓ | ✓ | ✓ | ✓ | |
Windows 10 / Server 2016 | x86_64 | Enterprise | ✓ | ✓ | ✓ | ||
Windows 10 / Server 2016 | x86_64 | Community | ✓ | ✓ | ✓ | ||
macOS 14 | x86_64 | Enterprise | ✓ | ||||
macOS 14 | x86_64 | Community | ✓ | ||||
macOS 13 | x86_64 | Enterprise | ✓ | ✓ | |||
macOS 13 | x86_64 | Community | ✓ | ✓ | |||
macOS 12 | x86_64 | Enterprise | ✓ | ✓ | |||
macOS 12 | x86_64 | Community | ✓ | ✓ | |||
macOS 11 | x86_64 | Enterprise | ✓ | ✓ | |||
macOS 11 | x86_64 | Community | ✓ | ✓ | |||
macOS 10.15 | x86_64 | Enterprise | ✓ | ✓ | ✓ | ||
macOS 10.15 | x86_64 | Community | ✓ | ✓ | ✓ | ||
macOS 10.14 | x86_64 | Enterprise | ✓ | ✓ | |||
macOS 10.14 | x86_64 | Community | ✓ | ✓ | |||
macOS 10.13 | x86_64 | Enterprise | ✓ | ||||
macOS 10.13 | x86_64 | Community | ✓ | ||||
macOS 14 | arm64 | Enterprise | ✓ | ||||
macOS 14 | arm64 | Community | ✓ | ||||
macOS 13 | arm64 | Enterprise | ✓ | ✓ | |||
macOS 13 | arm64 | Community | ✓ | ✓ | |||
macOS 12 | arm64 | Enterprise | ✓ | ✓ | |||
macOS 12 | arm64 | Community | ✓ | ✓ | |||
macOS 11 | arm64 | Enterprise | ✓ | ✓ | |||
macOS 11 | arm64 | Community | ✓ | ✓ | |||
Amazon Linux 2023 | arm64 | Enterprise | ✓ | ✓ | |||
Amazon Linux 2023 | arm64 | Community | ✓ | ✓ | |||
Amazon Linux 2 | arm64 | Enterprise | ✓ | ✓ | ✓ | 4.4.4+ | |
Amazon Linux 2 | arm64 | Community | ✓ | ✓ | ✓ | 4.4.4+ | |
RHEL/CentOS/Rocky/Alma 9 | arm64 | Enterprise | ✓ | ✓ | ✓ | ||
RHEL/CentOS/Rocky/Alma 9 | arm64 | Community | ✓ | ✓ | ✓ | ||
RHEL/CentOS/Rocky/Alma 8 | arm64 | Enterprise | ✓ | ✓ | ✓ | ✓ | 4.4.4+ |
RHEL/CentOS/Rocky/Alma 8 | arm64 | Community | ✓ | ✓ | ✓ | ✓ | 4.4.4+ |
Ubuntu 24.04 | arm64 | Enterprise | ✓ | ||||
Ubuntu 24.04 | arm64 | Community | ✓ | ||||
Ubuntu 22.04 | arm64 | Enterprise | ✓ | ✓ | 6.0.4+ | ||
Ubuntu 22.04 | arm64 | Community | ✓ | ✓ | 6.0.4+ | ||
Ubuntu 20.04 | arm64 | Enterprise | ✓ | ✓ | ✓ | ✓ | ✓ |
Ubuntu 20.04 | arm64 | Community | ✓ | ✓ | ✓ | ✓ | ✓ |
Ubuntu 18.04 | arm64 | Enterprise | ✓ | ✓ | ✓ | ||
Ubuntu 18.04 | arm64 | Community | ✓ | ✓ | ✓ | ||
Ubuntu 16.04 | arm64 | Enterprise | ✓ | ||||
RHEL/Rocky/Alma 9 | ppc64le | Enterprise | ✓ | ✓ | |||
RHEL/Rocky/Alma 8 [ 7 ] | ppc64le | Enterprise | ✓ | ✓ | ✓ | ✓ | ✓ |
RHEL/CentOS 7 | ppc64le | Enterprise | 6.0.7+ | ✓ | ✓ | ||
RHEL/Rocky/Alma 9 | s390x | Enterprise | ✓ | ✓ | |||
RHEL/Rocky/Alma 8 [ 7 ] | s390x | Enterprise | ✓ | ✓ | ✓ | 5.0.9+ | |
RHEL/CentOS 7 | s390x | Enterprise | ✓ | ✓ | ✓ | ||
RHEL/CentOS 7 | s390x | Community | ✓ | ✓ |
[1] | (1、2、3、4、5、6、7、8) 在 Oracle Linux 上,MongoDB 仅支持 Red Hat Compatible Kernel。 |
[2] | MongoDB 仅支持运行 Red Hat Compatible Kernel (RHCK) 的 Oracle Linux。MongoDB 不支持 Unbreakable Enterprise Kernel (UEK)。 |
[3] | 针对 RHEL 版本 8.0+ 发布的 MongoDB 本地部署产品,与 Rocky Linux 版本 8.0+ 和 AlmaLinux 版本 8.0+ 兼容并受支持(前提是这些发行版能满足其承诺,提供完整的 RHEL 兼容性)。 |
[4] | MongoDB 版本 5.0 及更高版本针对 SLES 12 Service Pack 5 进行了测试。MongoDB 的早期版本针对不带服务包的 SLES 12 进行了测试。 |
[5] | MongoDB 版本 7.0 及更高版本针对 SLES 12 Service Pack 4 进行测试。早期版本的 MongoDB 针对不带服务包的 SLES 12 进行测试。 |
[6] | MongoDB 版本 7.0 针对 RHEL 7.9 进行构建和测试。早期版本的 MongoDB 针对 RHEL 7 进行测试,并假定支持向前兼容。 |
[ 7 ] | (1、2)PPC64LE 和 s390x 上的 RHEL 8 不支持 MongoDB 8.0 及更高版本中使用的 TCMalloc 更新版。在这些架构上,RHEL 8 使用旧版的 TCMalloc。要了解更多信息,请参阅用于自管理部署的 TCMalloc 性能优化。 |
[ 8 ] | PPC64LE 和 s390x 上的 RHEL 9 不支持 MongoDB 8.0 及更高版本中使用的 TCMalloc 的更新版本。在这些架构上,RHEL 9 使用旧版的 TCMalloc。要了解更多信息,请参阅 用于自管理部署的 TCMalloc 性能优化。 |