Escolar Documentos
Profissional Documentos
Cultura Documentos
Introduction
MongoDB is a free, distributed, and an open-source document database at its core that
powers high availability, horizontal scaling, and geographic distribution. It stores data in
JSON-like documents and supports Ad hoc queries, indexing, and real-time aggregation.
Install MongoDB
Step 1: Import the MongoDB repository
The Ubuntu package management tools ensure package consistency and authenticity by
verifying that they are signed with GPG keys. The following command will import the
MongoDB public GPG key.
You must specify each component package specifically with their version number, check
the following example:
We need to create a unit file, which tells systemd how to manage a resource. Most
common unit type, service, determine how to start or stop the service, auto-start etc.
Check if mongodb has been started on port 27017 with netstat command:
The output to the above command will show `active (running)` status with the PID and
Memory/CPU it is consuming.
Stop MongoDB
Restart MongoDB
> sudo systemctl restart mongodb
> mongo
Connect MongoDB
Restart MongoDB( command mentioned above ) and connect with user created with this
command:
You can see the mongo connecting. Check the databases using the following command:
Warning: All configuration and databases will be completely removed after this process.
And it is irreversible, so ensure that all of your configuration and data is backed up
before proceeding.
Remove packages
Stop the service using the above command and run below command to remove
packages.
You have now learned how to install (and uninstall) MongoDB on Ubuntu 16.04.
If you have ever faced issues installing Kafka on Ubuntu, here’s a step wise guide.
Related Posts
Pricing Team