

Simplify the Use of ENV Variables in Percona Monitoring and Management AMI
source link: https://www.percona.com/blog/simplify-use-of-env-variables-in-percona-monitoring-and-management-ami/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Simplify the Use of ENV Variables in Percona Monitoring and Management AMI
February 1, 2024
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:
PMM_DEBUG=1 DATA_RETENTION=2160h |
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:
sudo systemctl edit supervisord.service |
[Service] EnvironmentFile=/srv/.env |
Step three: Restarting the supervisord service
After applying the changes, restart the supervisord service:
sudo systemctl daemon-reload sudo systemctl restart supervisord |
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
Share This Post!
</div
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK