1

While i am trying to install MongoDB in my system following the official documentation, everything is going fine but when i try to start the server there is some error :Image of error showing

Hope someone can help me out.

  • 1
    Please don't paste screenshots, use formatted text. See https://meta.stackoverflow.com/q/285551 – Wernfried Domscheit Jun 03 '22 at 07:14
  • Have a look at the mongod logfile, typically `/var/log/mongodb/mongod.log`. Most likely you did not create the folder for `dpPath` (default `/var/lib/mongodb`, see [What is the default database path for MongoDB?](https://stackoverflow.com/questions/12738322/what-is-the-default-database-path-for-mongodb/67043090#67043090)) and granted permissions to it. – Wernfried Domscheit Jun 03 '22 at 07:16

2 Answers2

-1

Just follow this simple step to install MongoDB on latest Ubuntu 22.04

sudo apt update

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

echo "deb http://security.ubuntu.com/ubuntu impish-security main" | sudo tee /etc/apt/sources.list.d/impish-security.list

sudo apt update

sudo apt install dirmngr gnupg apt-transport-https ca-certificates software-properties-common libssl1.1

wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -

sudo apt  update
sudo apt install -y mongodb-org

References:
https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/ https://www.mongodb.com/community/forums/t/installing-mongodb-over-ubuntu-22-04/159931/3

Rwitesh Bera
  • 389
  • 2
  • 3
  • 9
-2

Follow this step

echo "deb http://security.ubuntu.com/ubuntu impish-security main" | sudo tee /etc/apt/sources.list.d/impish-security.list

sudo apt-get update

sudo apt-get install libssl1.1

echo "* Installing Mongod..."
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list

sudo apt-get update -y
sudo apt-get install -y mongodb-org
sudo service mongod start
sudo service mongod status
Piyush Prajapati
  • 449
  • 1
  • 4
  • 7