How To Install Mongodb In Ubuntu 14.04 Lts
MongoDB is a total flexible alphabetize back up and rich queries database. Mongodb is a NoSQL database. MongoDB provides large media storage with GridFS. Click here for more details about this version of MongoDB.
This tutorial volition help you to install MongoDB 4.4 community release on Ubuntu 20.04 LTS (Focal), 18.04 LTS (Bionic) and sixteen.04 LTS (Xenial) systems.
Step 1 – Setup Apt Repository
Kickoff of all, import GPK key for the MongoDB apt repository on your system using the following command. This is required to test packages before installation
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:lxxx --recv 656408E390CFB1F5
Lets add MongoDB APT repository url in /etc/apt/sources.listing.d/mongodb.list.
Ubuntu xviii.04 LTS:
repeat "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/iv.iv multiverse" | sudo tee /etc/apt/sources.list.d/mongodb.list
Ubuntu 16.04 LTS:
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.iv multiverse" | sudo tee /etc/apt/sources.list.d/mongodb.list
Step 2 – Install MongoDB on Ubuntu
Later calculation required APT repositories, employ the following commands to install MongoDB on your systems. It will also install all dependent packages required for MongoDB.
sudo apt update sudo apt install mongodb-org
If yous want to install whatever specific version of MongoDB, define the version number as below
sudo apt install mongodb-org=iv.iv.1 mongodb-org-server=four.iv.1 mongodb-org-vanquish=4.four.1 mongodb-org-mongos=4.4.1 mongodb-org-tools=4.4.1
Step 3 – Manage MongoDB Service
After installation, MongoDB will showtime automatically. To get-go or terminate MongoDB uses init script. Below are the case commands to practice.
sudo systemctl enable mongod.service sudo systemctl start mongod.service
Once the service started, bank check the status by running control:
sudo systemctl status mongod.service
Use the following commands to stop or restart MongoDB service.
sudo systemctl cease mongod.service sudo systemctl restart mongod.service
- How to Piece of work with MongoDB – Read this tutorial
Step 4 – Verify MongoDB Installation
Finally, utilize the below command to check installed MongoDB version on your organisation.
mongod --version
Output:
db version v4.iv.ane Build Info: { "version": "four.4.1", "gitVersion": "ad91a93a5a31e175f5cbf8c69561e788bbc55ce1", "openSSLVersion": "OpenSSL 1.1.1 xi Sep 2022", "modules": [], "allocator": "tcmalloc", "environment": { "distmod": "ubuntu1804", "distarch": "x86_64", "target_arch": "x86_64" } }
Also, connect MongoDB using the control line and execute some examination commands for checking proper working.
mongo > use mydb; > db.colors.insert({ "id": 100, "color": "Pinkish"}) > db.colors.insert({ "id": 101, "color": "Majestic"}) > db.colors.detect() { "_id" : ObjectId("5f75a76194d0a08201f26f25"), "id" : 100, "colour" : "Pink" } { "_id" : ObjectId("5f75a7d594d0a08201f26f26"), "id" : 101, "colour" : "Imperial" }
More than Useful tutorials
Here is the list of useful tutorials for MongoDB server.
- Create and Drop database in Mongodb
- Enable hallmark in Mongodb
- Beat script to backup Mongodb
- Fill-in and restore database in Mongodb
Conclusion
In this tutorial, you lot take learned to install MongoDB database server on Ubuntu system.
Source: https://tecadmin.net/install-mongodb-on-ubuntu/
Posted by: murphycalat1937.blogspot.com
0 Response to "How To Install Mongodb In Ubuntu 14.04 Lts"
Post a Comment