Using Different Mount Points on PMM Docker Deployments

Using Different Mount Points on PMM Docker Deployments

PREVIOUS POST
NEXT POST

Mount Points on PMM DockerIn this blog post, we’ll see how to use different mount points on PMM Docker deployments (Percona Monitoring and Management). This is useful if you want to use other mount points for the different directories, or even if you want to use a custom path that is not bound to Docker’s volumes directory (which is /var/lib/docker/volumes/ by default) within the same mount point.

There are two ways in which you can achieve this:

  • using symlinks after the pmm-data container is created
  • modifying the docker create command to use different directories

In the following examples, /pmm/ is used as the new base directory. One can, of course, choose different directories for each if needed. Also, remember to be aware of any SELinux or AppArmor policies you may have in place.

Using symlinks

For this, we need to follow these steps:

  1. Create the needed directories
  2. Create the pmm-data container
  3. Move contents from default Docker paths to the desired paths
  4. Create symlinks that point to the moved directories

Let’s see this with some commands and outputs. In this example, we will use /pmm/ as if it were the new mount point:

After this, we can start the pmm-server container (see below).

Modifying the docker create command

For this, we need to follow these other steps:

  1. Create the needed directories
  2. Create a temporary pmm-data container
  3. Copy its contents to the new locations, and delete it (the temporary container)
  4. Create the permanent pmm-data container with the modified paths (-v arguments)
  5. Fix ownership of files in the copied directories (to avoid errors when starting the pmm-server container later on)

Let’s see this in practical terms again, assuming we want to use the /pmm/ mount point.

After this, we can start the pmm-server container (see below).

Running pmm-server container

After following either of the steps mentioned above, we can run the pmm-server container with the exact same commands as shown in the online documentation:

And that’s it! Now you should have custom mount points on PMM docker deployment.

PREVIOUS POST
NEXT POST

Share this post

Leave a Reply