This blog post is another in the series on the Percona Server for MongoDB 3.4 bundle release. The purpose of this blog post is to demonstrate current best-practices for an in-place Percona Monitoring and Management (PMM) upgrade. Following this method allows you to retain data previously collected by PMM in your MySQL or MongoDB environment, while upgrading to the latest version.
Step 1: Housekeeping
Before beginning this process, I recommend that you use a package manager that installs directly from Percona’s official software repository. The install instructions vary by distro, but for Ubuntu users the commands are:
wget https://repo.percona.com/apt/percona-release_0.1-4.$(lsb_release -sc)_all.deb
sudo dpkg -i percona-release_0.1-4.$(lsb_release -sc)_all.deb
Step 2: PMM Server Upgrade
Now that we have ensured we’re using Percona’s official software repository, we can continue with the upgrade. To check which version of PMM server is running, execute the following command on your PMM server host:
This command shows a list of all running Docker containers. The version of PMM server you are running is found in the image description.
Once you’ve verified you are on an older version, it’s time to upgrade!
The first step is to stop and remove your docker pmm-server container with the following command:
docker stop pmm-server && docker rm pmm-server
Please note that this command may take several seconds to complete.
The next step is to create and run the image with the new version tag. In this case, we are installing version 1.1.0. Please make sure to verify the correct image name in the install instructions.
Run the command below to create and run the new image.
docker run -d
We can confirm our new image is running with the following command:
As you can see, the latest version of PMM server is installed. The final step in the process is to update the PMM client on each host to be monitored.
Step 3: PMM Client Upgrade
The GA version of Percona Monitoring and Management supports in-place upgrades. Instructions can be found in our documentation. On the client side, update the local apt cache, and upgrade to the new version of pmm-client by running the following commands:
apt-get install pmm-client
Congrats! We’ve successfully upgraded to the latest PMM version. As you can tell from the graph below, there is a slight gap in our polling data due to the downtime necessary to upgrade the version. However, we have verified that the data that existed prior to the upgrade is still available and new data is being gathered.
I hope this blog post has given you the confidence to do an in-place Percona Monitoring and Management upgrade. As always, please submit your feedback on our forums with regards to any PMM-related suggestions or questions. Our goal is to make PMM the best-available open-source MySQL and MongoDB monitoring tool.