Where the open source database community meets: Use code PERCONA75 and secure your spot for Percona Live.  Register

Simplify the Use of ENV Variables in Percona Monitoring and Management AMI

February 1, 2024
Author
Nurlan Moldomurov
Share this Post:

The Percona Monitoring and Management (PMM) Amazon Machine Image (AMI) currently lacks native support for ENV variables. In this guide, we’ll walk through a straightforward workaround that simplifies the process of using ENV variables in PMM AMI and reapplying them after an upgrade.

Step one: Adding ENV variables to /srv/.env

Begin by consolidating your ENV variables in the /srv/.env file. Edit the file and add your variables, like so:

Step two: Using systemctl edit for systemd service

To avoid directly modifying the /usr/lib/systemd/system/supervisord.service file, which could be overwritten during system upgrades, leverage systemctl edit for a more sustainable approach. Open a terminal and run:


This command opens an editor for creating an override file. Add the following lines to set the environment file:


Save and exit the editor.

Step three: Restarting the supervisord service

After applying the changes, restart the supervisord service:


Post-upgrade consideration

While PMM currently rewrites /usr/lib/systemd/system/supervisord.service on each upgrade, the modifications made using systemctl edit remain safeguarded.

By adopting the systemctl edit approach, your ENV variable setup remains intact, offering a cleaner and more maintainable configuration for your PMM AMI.

Percona Monitoring and Management is a best-of-breed open source database monitoring solution. It helps you reduce complexity, optimize performance, and improve the security of your business-critical database environments, no matter where they are located or deployed.

Download Percona Monitoring and Management Today

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Far
Enough.

Said no pioneer ever.
MySQL, PostgreSQL, InnoDB, MariaDB, MongoDB and Kubernetes are trademarks for their respective owners.
© 2026 Percona All Rights Reserved