How to Setup PMM(Percona Monitoring and Management) server and Register PMM client on Ubuntu for MongoDB
In this article we will see how to configure PMM (Percona Monitoring and Management) server and PMM Client setup for MongoDB.
PMM Architecture Source: https://www.percona.com/ |
Prerequisites:
1. We need to have Docker 1.12.6 or higher installed.
PMM Server Installation:
Pull the image.
docker pull percona/pmm-server:2
Create a persistent data container.
docker create --volume /srv \ --name pmm-data \ percona/pmm-server:2 /bin/true
Run the image.
docker run --detach --restart always \ --publish 443:443 \ --volumes-from pmm-data \ --name pmm-server \ percona/pmm-server:2
Devopszones: Create volume |
devopszones: PMM server Install |
3. Connect to Percona Monitoring and Management:
https://<IP Address or hostname of your Percona Monitoring and Management Server>/
Default username/password is admin/admin and should be changed on first login.
Devopszones: PMM Login Page |
Install Client
1. Download Percona Repo Package
wget https://repo.percona.com/apt/percona-release_latest.$(lsb_release -sc)_all.deb
2. Install Percona Repo Package
sudo dpkg -i percona-release_latest.$(lsb_release -sc)_all.deb
3. Update apt cache
sudo apt-get update
4. Install Percona Monitoring and Management Client
sudo apt-get install pmm2-client
sudo apt-get update
sudo apt-get install pmm2-client
Devopszones: PMM2 Admin Version |
Connect Client to Server
Requirements: Client to server communication to secure port on pmm-server (443 assumed) — must be performed on every system to be monitored.
Register Percona Monitoring and Management client with server
sudo pmm-admin config --server-insecure-tls --server-url=https://admin:<password>@<PMM Server IP>
Devopszones: PMM2 client Register |
MongoDB
Create a Percona Monitoring and Management specific user for monitoring (from the MongoDB CLI)
Enter the MongoDB Console: mongo
use admin
db.createRole({
role: "explainRole",
privileges: [{
resource: {
db: "",
collection: ""
},
actions: [
"listIndexes",
"listCollections",
"dbStats",
"dbHash",
"collStats",
"find"
]
}],
roles:[]
})
db.getSiblingDB("admin").createUser({
user: "pmm",
pwd: "<password>",
roles: [
{ role: "explainRole", db: "admin" },
{ role: "clusterMonitor", db: "admin" },
{ role: "read", db: "local" }
]
})
exit
Register the server for monitoring
sudo pmm-admin add mongodb --username=pmm --password=<password>
Easy-install script
Linux
curl -fsSL -O https://raw.githubusercontent.com/percona/pmm/PMM-2.0/get-pmm.sh -O https://raw.githubusercontent.com/percona/pmm/PMM-2.0/.sha256-oneline && \
sha256sum .sha256-oneline -c && \
chmod +x ./get-pmm.sh && \
./get-pmm.sh
How to Backup and Restore PMM(Percona Monitoring and Management) server Data
No comments