This documentation is for the end of life version of Percona Server for MongoDB and is no longer supported. You may want to see the current documentation.
Installing Percona Server for MongoDB on Debian and Ubuntu¶
Note
Percona Server for MongoDB should work on other DEB-based distributions, but it is tested only on platforms listed above on the Percona Software and Platform Lifecycle page.
Package Contents¶
percona-server-mongodb-36
Installs the
mongo
shell, import/export tools, other client utilities, server software, default configuration, and init.d scripts.percona-server-mongodb-36-server
Contains the
mongod
server, default configuration files, and init.d scripts.percona-server-mongodb-36-shell
Contains the
mongo
shell.percona-server-mongodb-36-mongos
Contains the
mongos
sharded cluster query router.percona-server-mongodb-36-tools
Contains Mongo tools for high-performance MongoDB fork from Percona.
percona-server-mongodb-36-dbg
Contains debug symbols for the server.
Installing from Percona Repositories¶
It is recommended to install Percona Server for MongoDB from official Percona repositories.
Configure Percona repositories as described in Percona Software Repositories Documentation.
Install the latest version¶
Starting from Percona Server for MongoDB 3.6.19-7.0, the packages are located in the psmdb-36
repository. To install the latest version of Percona Server for MongoDB, do the following:
Enable the repository.
$ sudo percona-release enable psmdb-36
Install the required Percona Server for MongoDB package using apt-get. For example, to install the full package, run the following:
$ sudo apt-get install percona-server-mongodb-36
Install a specific version¶
Percona Server for MongoDB versions earlier than 3.6.19-7.0 are available for download on the Percona website.
Select the desired version and your operating system from the drop-down menus.
Download the package bundle. The permalink for download is generated for you based on your selections in the format
https://www.percona.com/downloads/percona-server-mongodb-3.6/<release_version>/binary/<OS>/<OS_version>/x86_64/<package_name>
.For example, to download Percona Server for MongoDB 3.6.14-3.4 for Debian Buster, use the following URL:
$ wget https://www.percona.com/downloads/percona-server-mongodb-3.6/percona-server-mongodb-3.6.14-3.4/binary/debian/buster/x86_64/percona-server-mongodb-3.6.14-3.4-r0985495-buster-x86_64-bundle.tar
Unpack the archive
$ tar xfv percona-server-mongodb-3.6.14-3.4-r0985495-buster-x86_64-bundle.tar
Install the packages
$ sudo dpkg -i percona-server-mongodb-36_3.6.14-3.4.buster_amd64.deb \ percona-server-mongodb-36-dbg_3.6.14-3.4.buster_amd64.deb \ percona-server-mongodb-36-mongos_3.6.14-3.4.buster_amd64.deb \ percona-server-mongodb-36-server_3.6.14-3.4.buster_amd64.deb \ percona-server-mongodb-36-shell_3.6.14-3.4.buster_amd64.deb \ percona-server-mongodb-36-tools_3.6.14-3.4.buster_amd64.deb
Note
If
dpkg
fails at this step due to missing dependencies, runapt
as follows:$ sudo apt-get install --fix-broken
Using Percona Server for MongoDB¶
By default, Percona Server for MongoDB stores data files in /var/lib/mongodb/
and configuration parameters in /etc/mongod.conf
.
Starting the service
Percona Server for MongoDB is started automatically after installation unless it encounters errors during the installation process. You can also manually start it using the following command:
$ sudo systemctl start mongod
Confirming that the service is running
Check the service status using the following command:
$ sudo systemctl status mongod
Stopping the service
Stop the service using the following command:
$ sudo systemctl stop mongod
Restarting the service
Restart the service using the following command:
$ sudo systemctl restart mongod
Uninstalling Percona Server for MongoDB¶
To uninstall Percona Server for MongoDB, remove all the installed packages. Removing packages with apt-get remove will leave the configuration and data files. Removing the packages with apt-get purge will remove all the packages with configuration files and data. Depending on your needs you can choose which command better suits you.
Stop the server:
$ sudo systemctl stop mongod
Remove the packages.
If you want to leave configuration and data files:
$ sudo apt-get remove percona-server-mongodb*
If you want to delete configuration and data files as well as the packages:
$ sudo apt-get purge percona-server-mongodb*