When deployed through Docker Percona Monitoring and Management (PMM) uses environment variables for its configuration
For example, if you want to adjust metrics resolution you can pass
-e METRICS_RESOLUTION=Ns
as an option to the
docker run
command:
docker run -d \ -p 80:80 \ --volumes-from pmm-data \ --name pmm-server \ --restart always \ -e METRICS_RESOLUTION=2s \ percona/pmm-server:latest
You would think if you want to change the setting for existing installation you can just stop the container with
docker stop
and when you want to start, passing new environment variable with
docker start
Unfortunately, this is not going to work as
docker start
does not support changing environment variables, at least not at the time of writing. I assume the idea is to keep container immutable and if you want container with different properties—like environment variables—you should run a new container instead. Here’s how.
Stop and Rename the old container, just in case you want to go back
docker stop pmm-server docker rename pmm-server pmm-server-old
Refresh the container with the latest version
docker pull percona/pmm-server:latest
Do not miss this step! When you destroy and recreate the container, all the updates you have done through PMM Web interface will be lost. What’s more, the software version will be reset to the one in the Docker image. Running an old PMM version with a data volume modified by a new PMM version may cause unpredictable results. This could include data loss.
Run the container with the new settings, for example changing METRICS_RESOLUTION
docker run -d \ -p 80:80 \ --volumes-from pmm-data \ --name pmm-server \ --restart always \ -e METRICS_RESOLUTION=5s \ percona/pmm-server:latest
After you’re happy with your new container deployment you can remove the old container
docker rm pmm-server-old
That’s it! You should have running the latest PMM version with updated configuration settings.
The post How to Change Settings for PMM Deployed via Docker appeared first on Percona Database Performance Blog.