Skip to content

Install Percona Server for MongoDB on Amazon Linux 2023

This guide walks you through the installation of Percona Server for MongoDB on Amazon Linux 2023.

We gather Telemetry data to understand the use of the software and improve our products.

Compatibility with Amazon Linux 2023

We build and test Percona Server for MongoDB only on the latest versions of Amazon Linux 2023. Because of the way Amazon Linux updates their libraries, Percona Server for MongoDB works only on specific Amazon Linux versions.

The following table shows Percona Server for MongoDB versions that are supported on specific versions of Amazon Linux 2023:

Percona Server for MongoDB version Amazon Linux 2023 version
7.0.16-10 2023.6.x and earlier
7.0.18-11 2023.7.x and newer

To upgrade Percona Server for MongoDB, make sure that you run a compatible version of Amazon Linux 2023. Use the update instructions to update the operating system.

Package contents
Package Contains
percona-server-mongodb The mongosh shell, import/export tools, other client utilities, server software, default configuration, and init.d scripts.
percona-server-mongodb-server The mongod server, default configuration files, and init.d scripts
percona-server-mongodb-shell The mongosh shell
percona-server-mongodb-mongos The mongos sharded cluster query router
percona-server-mongodb-tools Mongo tools for high-performance MongoDB fork from Percona
percona-server-mongodb-dbg Debug symbols for the server

Procedure

Before you start, check the system requirements.

Configure Percona repository

Percona provides the percona-release configuration tool that simplifies operating repositories and enables to install and update both Percona Server for MongoDB packages and required dependencies smoothly.

  1. Install percona-release:

    $ sudo yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm
    
    Example output
    Retrieving https://repo.percona.com/yum/percona-release-latest.noarch.rpm
    Preparing...                ########################################### [100%]
    1:percona-release        ########################################### [100%]
    
  2. Enable the repository:

    $ sudo percona-release enable psmdb-70 release
    

Install Percona Server for MongoDB packages

To install the latest version of Percona Server for MongoDB, use the following command:

$ sudo yum install percona-server-mongodb

To install a specific version of Percona Server for MongoDB, do the following:

  1. List available versions:

    $ sudo yum list percona-server-mongodb --showduplicates
    

    Sample output:

        Available Packages
    
    percona-server-mongodb.aarch64    7.0.18-11.amzn2023       psmdb-70-release-aarch64
    
  2. Install a specific version packages. For example, to install Percona Server for MongoDB 7.0.18-11, run the following command:

    $ sudo yum install percona-server-mongodb-7.0.18-11.amzn2023
    

By default, Percona Server for MongoDB stores data files in /var/lib/mongodb/ and configuration parameters in /etc/mongod.conf.

Run Percona Server for MongoDB

Note

If you use SELinux in enforcing mode, you must customize your SELinux user policies to allow access to certain /sys and /proc files for OS-level statistics. Also, you must customize directory and port access policies if you are using non-default locations.

Please refer to Configure SELinux section of MongoDB Documentation for policy configuration guidelines.

Start the service

Percona Server for MongoDB is not started automatically after installation. Start it manually using the following command:

$ sudo systemctl start mongod

Confirm that service is running

Check the service status using the following command:

$ sudo systemctl status mongod

Stop the service

Stop the service using the following command:

$ sudo systemctl stop mongod

Restart the service

Restart the service using the following command:

$ sudo systemctl restart mongod

Run after reboot

The mongod service is not automatically started after you reboot the system.

To make it start automatically after reboot, enable it using the systemctl utility:

$ sudo systemctl enable mongod

Then start the mongod service:

$ sudo systemctl start mongod

Next steps

Connect to MongoDB