Set up Percona Monitoring and Management
Set up the monitoring of your database infrastructure
Read time 1 minuteLast updated 4 hours ago
To use Percona Monitoring and Management (PMM) to monitor your database infrastructure, complete the procedure in this section to integrate Percona Server for MongoDB (PSMDB) with PMM.
Prerequisites
Before you deploy PMM, ensure that this setup is complete:- When deploying Virtual Private Cloud, you have enabled PMM, that is, you have set the setting to true in the Terraform variables file.
enable_percona_monitoring - The resources and
ClusterRoleexist in the Kubernetes cluster.ClusterRoleBinding
1. Expose the PMM web interface
To expose the PMM web interface, complete these steps:- Create an Ingress resource for the PMM web interface in your Kubernetes cluster.
- Add a DNS record that points to the PMM service in your DNS provider, for example, Route 53.
- Ensure that the PMM service is accessible through the configured domain name.
2. Access the PMM web interface
To access the PMM web interface, complete these steps:- Go to the PMM web interface using your configured domain name.
-
Sign in with the username. To retrieve the password, run this command:
adminkubectl get secret pmm-admin-password -o jsonpath="{.data.GF_SECURITY_ADMIN_PASSWORD}" | base64 --decode
3. Create a token to integrate PSMDB with PMM
To integrate PSMDB with PMM, create a token in PMM:- In the PMM web interface, go to Administration > Service Accounts.
- Select Add Service Account.
- Enter a descriptive name for the service account, choose Admin role and then select Create.
- Select Add service account Token.
- Copy the generated API key, and then save it to a secure location.
-
Update the Terraform variable with the API key in your configuration file. The entry must have this format:
psmdb_pmm_server_tokenpsmdb_pmm_server_token = "<YOUR_PMM_TOKEN>" -
To apply the changes, run this command:
cd aws/terraform make apply-us-east-1
4. Validate the metrics collection
To validate that the metrics collection is working correctly, complete these verification steps:-
Ensure that there are no access errors. To check the PSMDB pod logs, run this command:
kubectl logs psmdb-db-rs0-0 -c pmm-client - To verify that the metrics are being collected in the PMM web interface, consult the MongoDB metrics in the MongoDB section.