Berikut ini langkah2 menginstall mongodb mengunakan sistem operasi linux dengan distro ubuntu versi 22.10
- Import public key
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
Jalankan kode tersebut, maka akan memunculkan output bertuliskan OK
- Membuat file list
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
- Reload package local
sudo apt-get update
- Install package mongoDB
sudo apt-get install -y mongodb-org
- Start server mongodb
sudo systemctl daemon-reload
sudo systemctl start mongod
sudo systemctl status mongod
Troubleshooting
Jika anda mendapatkan error Process: 8724 ExecStart=/usr/bin/mongod --quiet --config /etc/mongod.conf (code=exited, status=14)
masukkan perintah berikut.
chown -R mongodb:mongodb /var/lib/mongodb
chown mongodb:mongodb /tmp/mongodb-27017.sock
sudo service mongod restart
Sumber:
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
https://askubuntu.com/questions/823288/mongodb-loads-but-breaks-returning-status-14
Top comments (0)