以下是在Ubuntu环境配置MongoDB的步骤:
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -。echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -sc)/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list。sudo apt update。sudo apt install -y mongodb-org。sudo systemctl start mongod,并设置开机自启sudo systemctl enable mongod。sudo systemctl status mongod查看服务状态,或mongo --version查看版本。/etc/mongod.conf,可按需修改,如设置bindIp、port、dbPath等。