资讯动态

Rocky10 安装mongodb 8.0

发布时间:2026/10/1 2:23:25 来源:尧图企业网站定制
配置官方 YUM 源MongoDB 默认不在 Rocky Linux 官方仓库中需手动配置。sudovi/etc/yum.repos.d/mongodb-org-8.0.repo粘贴以下内容基于 x86_64 架构[mongodb-org-8.0]nameMongoDB Repositorybaseurlhttps://repo.mongodb.org/yum/redhat/10/mongodb-org/8.0/x86_64/gpgcheck1enabled1gpgkeyhttps://pgp.mongodb.com/server-8.0.asc执行安装sudodnfinstall-ymongodb-org此命令会自动安装 mongodb-org-server、mongosh 等核心组件。启动并验证服务启动并设置开机自启sudosystemctlenable--nowmongod验证服务状态sudosystemctl status mongod查看版本确认安装成功mongod--version关闭Mongosudosystemctl stop mongod修改 /etc/mongod.conf例如:# mongod.conf# for documentation of all options, see:# http://docs.mongodb.org/manual/reference/configuration-options/# where to write logging data.systemLog:destination:filelogAppend:truepath:/var/log/mongodb/mongod.log# Where and how to store data.storage:dbPath:/var/lib/mongo# how the process runsprocessManagement:timeZoneInfo:/usr/share/zoneinfo# network interfacesnet:port:27017bindIp:127.0.0.1# Enter 0.0.0.0,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.#security:#operationProfiling:#replication:#sharding:## Enterprise-Only Options#auditLog:打开Mongosudosystemctl start mongod

读完文章,也想定制专属网站?

尧图设计师 24 小时内与您沟通定制方案

免费获取报价 →
↑