June 8, 2020 / Nirav Shah
What is MongoDB?
As per Wikipedia “MongoDB is a cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas. MongoDB is developed by MongoDB Inc. and licensed under the Server Side Public License (SSPL)”.
Step 1
$ wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
The operation should respond with an OK.
$ sudo apt-get install gnupg
$ wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -
Step 2
$ sudo touch /etc/apt/sources.list.d/mongodb-org-4.2
Step 3
$ echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list
Step 4
$ sudo apt-get update
Step 5
$ sudo apt-get install -y mongodb-org
Step 6
$ sudo systemctl start mongod
$ sudo systemctl daemon-reload
Step 7
$ sudo systemctl status mongod
Step 8
$ sudo systemctl enable mongod
Step 9 (Optional)
$ sudo systemctl stop mongod
Step 10 (Optional)
$ sudo systemctl restart mongod
Step 11
$ sudo service mongod stop
Step 12
$ sudo apt-get purge mongodb-org*
# network interfaces net: port: 27017 bindIp: 0.0.0.0
# network interfaces net: port: 27017 bindIp: 192.168.1.100
# network interfaces net: port: 27017 bindIp: 127.0.0.1,192.168.1.100
$ sudo systemctl daemon-reload $ sudo systemctl restart mongod
As a Director of Eternal Web Private Ltd an AWS consulting partner company, Nirav is responsible for its operations. AWS, cloud-computing and digital transformation are some of his favorite topics to talk about. His key focus is to help enterprises adopt technology, to solve their business problem with the right cloud solutions.
Have queries about your project idea or concept? Please drop in your project details to discuss with our AWS Global Cloud Infrastructure service specialists and consultants.