The Percona Monitoring and Management (PMM) provides an excellent solution to monitor Percona Server for MongoDB.
Following steps are needed to install both PMM Client and PMM Server preconfigured to monitor Percona Server for MongoDB on Kubernetes or OpenShift.
The recommended installation approach is based on using helm - the package manager for Kubernetes, which will substantially simplify further steps. So first thing to do is to install helm following its official installation instructions.
When the helm is installed, add Percona chart repository and update information of available charts as follows:
$ helm repo add percona https://percona-charts.storage.googleapis.com $ helm repo update
Now helm can be used to install PMM Server:
$ helm install percona/pmm-server --name monitoring --set platform=openshift --set credentials.username=clusterMonitor --set "credentials.password=clusterMonitor123456"
It is important to specify correct options in the installation command:
platformshould be either
openshiftdepending on which platform are you using.
nameshould correspond to the
serverHostkey in the
pmmsection of the deploy/cr.yaml file with a “-service” suffix, so default
--name monitoringpart of the shown above command corresponds to a
monitoring-servicevalue of the
credentials.usernameshould correspond to the
MONGODB_CLUSTER_MONITOR_USERkey in the the deploy/mongodb-users.yaml file.
credentials.passwordshould correspond to a value of the
MONGODB_CLUSTER_MONITOR_PASSWORDkey specified in deploy/mongodb-users.yaml secrets file. Note that password specified in this example is the default development mode password not intended to be used on production systems.
- Now the PMM is installed, and it is time to update
pmmsection in the deploy/cr.yaml file.
- make sure that
serverHost(the PMM service name,
monitoring-serviceby default) is the same as one specified for the
nameparameter on the previous step, but with additional
- make sure that
PMM_PASSWORDkeys in the deploy/mongodb-users.yaml secrets file are the same as ones specified for the
credentials.passwordparameters on the previous step (if not, fix it and apply with the
kubectl apply -f deploy/mongodb-users.yamlcommand).
When done, apply the edited
$ kubectl apply -f deploy/cr.yaml
To make sure everything gone right, check that correspondent Pods are not continuously restarting (which would occur in case of any errors on the previous two steps):
$ kubectl get pods $ kubectl logs my-cluster-name-rs0-0 -c pmm-client
- Find the external IP address (
EXTERNAL-IPfield in the output of
kubectl get service/monitoring-service -o wide). This IP address can be used to access PMM via https in a web browser, with the login/password authentication, already configured and able to show Percona Server for MongoDB metrics.