MongoDB is a fully flexible index support and rich queries database. It is classified as a NoSQL database program, which uses JSON-like documents with optional schemas. Similar to the relational database system, the MongoDB database also supports joins in queries.
MongoDB has released a new stable version 4.4 with lots of major enhancements. This tutorial will help you to install MongoDB 4.4 on Fedora Linux systems.
Step 1 – Configure Repository
The MongoDB official team provides an Yum repository for installing MongoDB on a Fedora system. Create a new configuration file with Mongodb yum repository. Edit a file in a editor:
sudo vi /etc/yum.repos.d/mongodb.repo
Add the below content
[Mongodb] name=MongoDB Repository baseurl=https://repo.mongodb.org/yum/redhat/8/mongodb-org/4.4/x86_64/ gpgcheck=1 enabled=1 gpgkey=https://www.mongodb.org/static/pgp/server-4.4.asc
Save the file and close it.
Step 2 – Install MongoDB on Fedora
Let’s use the DNF package manager to install the MongoDB server on the Fedora system. This will also install all required dependencies to your system.
To install MongoDB on Fedora, type:
sudo dnf install mongodb-org mongodb-org-server
Step 3 – Start MongoDB Service
MongoDB server has been installed on your Fedora systems. Now enable the MongoDB systemd service and start it.
sudo systemctl enable mongod.service
sudo systemctl start mongod.service
Once the service is started, check the current status with the following command.
sudo systemctl status mongod.service
Step 4 – Connect to MongoDB Shell
As you have completed the MongoDB installation on your Fedora Linux system. First of all, verify the installed MongoDB version on your system with the following command.
mongod --version
Output:db version v4.4.4 Build Info: { "version": "4.4.4", "gitVersion": "8db30a63db1a9d84bdcad0c83369623f708e0397", "openSSLVersion": "OpenSSL 1.1.1k FIPS 25 Mar 2021", "modules": [], "allocator": "tcmalloc", "environment": { "distmod": "rhel80", "distarch": "x86_64", "target_arch": "x86_64" } }
Now, connect to the MongoDB shell using the mongo command-line utility. Also, execute some test commands for checking proper working.
mongo
> use mydb;
> db.test.save({ tecadmin: 1001 })
> db.test.find()
{ "_id" : ObjectId("60d472f31f5ba51557c8b066"), "tecadmin" : 1001 }
Conclusion
Congratulation’s You have successfully installed mongodb server on Fedora system. For practice only you may use MongoDB browser shell.
References:
http://docs.mongodb.org/manual/installation/
6 Comments
Many thanks
Well, that was easy!!
Thanks!!
Still working! Thanks for the post, it was just what I needed.
Still works as of May 10th, 2020! Great!
Dear Rahul,
Thanks for your support in Linux Environment. I request you to kindly guide me step by step to create and use AD services between Centos7 Server and CentOS7 Client. Hope the needful thanks in advance
Hey Rahul, Great tutorial on installing MangoDB on a Fedora. I run a blog that’s on VPS. Since the website (kidhealthcenter.com) receives few thousands visitors per day, the error log that the file creates, grows into 20GB and more in matters of a week time.
I would appreciate if you could provide tutorial on how to manage the space on the server and find files and folders that consumes huge amount of space and ways to clean them.