Master the setup of Percona Server for MongoDB on Debian or Ubuntu. Our MongoDB Support team is ready to answer your questions.
Get Started with Percona Server for MongoDB on Debian or Ubuntu
Percona Server for MongoDB is a powerful, open-source alternative to MongoDB Community Edition. It offers enterprise-grade enhancements such as improved performance, robust security features, and support for hot backups. This makes it an excellent choice for production environments.
If you’re dealing with issues like MongoError: Authentication failed (code 18) during your setup or configuration process, we’ve covered solutions here.
Today, we will walk through the process of installing Percona Server for MongoDB on Debian and Ubuntu using Percona’s official APT repositories.
Prerequisites
Before we begin, we need:
- A Debian or Ubuntu system (latest versions are supported)
- Root or sudo user privileges
- Internet connectivity for downloading the required packages
This tutorial installs MongoDB 8.0 Community Edition.
Step-by-Step Guide
- To install Percona Server for MongoDB, we will start by setting up the Percona APT repository. So, download the Percona repository package:
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
Copy Code - UbuntuThen, install the package:
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
Copy Code - Once installed, the Percona repositories will be available on the system. We can verify this by checking:
cat /etc/apt/sources.list.d/percona-release.list
Copy Code - Next, enable the Percona Server for MongoDB repository:
sudo percona-release enable psmdb-50 release
Copy Code - Now, update the local package cache:
sudo apt update
Copy Code - Now that the repository is enabled, install the server with:
sudo apt install percona-server-mongodb
Copy CodeBy default, Percona Server for MongoDB stores data files in `/var/lib/mongodb/` and the configuration file in `/etc/mongod.conf`.
- Percona Server for MongoDB starts automatically after installation. If it doesn’t, start it manually:
sudo systemctl start mongod
Copy CodeTo check the service status, run:
sudo systemctl status mongod
Copy CodeTo stop the service, run:
sudo systemctl stop mongod
Copy CodeWe can restart the service with this command:
sudo systemctl restart mongod
Copy Code
If you plan to use replica sets, make sure to troubleshoot common errors like [ReplicaSetNoPrimary] MongoDB Error
, explained in this article.
How to Uninstall Percona Server for MongoDB
If we need to uninstall Percona Server for MongoDB, follow these steps:
- Stop the MongoDB service with this command:
sudo systemctl stop mongod
Copy Code - To remove the packages:
If you’re tuning your MongoDB for performance, particularly around aggregation pipelines, check out our guide on MongoDB Aggregation Performance Tuning.
[Need assistance with a different issue? Our team is available 24/7.]
Conclusion
With the above steps, we will have Percona Server for MongoDB installed and running on our Debian or Ubuntu system. Don’t forget to enable authentication and configure user access for added security.
In brief, our Support Experts demonstrated how to setup of Percona Server for MongoDB on Debian or Ubuntu.
0 Comments