ubuntu 22.04安装mongodb7

1、环境更新

bash 复制代码
sudo apt update
sudo apt upgrade

要执行curl命令,需先安装此包

bash 复制代码
sudo apt-get install curl

2、生成MongoDB的gpg秘钥和向APT导入MongoDB7.0版软件包的资源链接

bash 复制代码
curl -fsSL https://pgp.mongodb.com/server-7.0.asc | sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor

echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list

sudo apt update

3、下载MongoDB并安装

安装MongoDB前需要安装libssl1.1

bash 复制代码
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb

sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb

安装mongodb

bash 复制代码
sudo apt-get install -y mongodb-org

4、启动MongoDB服务并设置开机启动和查询运行状态

bash 复制代码
sudo systemctl start mongod

sudo systemctl enable mongod

sudo systemctl status mongod
相关推荐
orion578 小时前
Missing Semester Class1:course overview and introduction of shell
linux
SkyWalking中文站13 小时前
认识 Horizon UI · 6/17:Trace 探索器
运维·监控·自动化运维
用户1204872216115 小时前
Linux驱动编译与加载
linux·嵌入式
火车叼位16 小时前
写给初级开发者:SSL、SSH、HTTPS 与证书体系全解析
运维
用户8055336980321 小时前
Input 子系统架构:Core、Handler、Driver 三层是怎么协作的
linux·嵌入式
用户8055336980321 小时前
RK-Forge外设系列开篇 - 把板子从「能启动」变成「能用」:Ethernet/SPI/MMC 三个纯接线外设
linux·github·嵌入式
葫芦和十三1 天前
图解 MongoDB 24|分片为什么存在:垂直扩容的天花板
后端·mongodb·agent
小猿姐1 天前
唯品会大规模数据库云原生实践:基于 KubeBlocks 管理数千实例的统一运维之路
运维·elasticsearch·云原生
葫芦和十三1 天前
图解 MongoDB 23|两地三中心:跨可用区部署怎么扛机房故障
后端·mongodb·agent
七歌杜金房1 天前
我终于又有了自己的 Linux 电脑
linux·debian·mac