Skip to content
logo
Percona Operator for MongoDB
Monitor with Percona Monitoring and Management (PMM)
Initializing search
    percona/k8spsmdb-docs
    percona/k8spsmdb-docs
    • Welcome
      • System requirements
      • Design and architecture
      • Comparison with other solutions
      • Install with Helm
      • Install with kubectl
      • Install on Minikube
      • Install on Google Kubernetes Engine (GKE)
      • Install on Amazon Elastic Kubernetes Service (AWS EKS)
      • Install on Microsoft Azure Kubernetes Service (AKS)
      • Generic Kubernetes installation
      • Install on OpenShift
      • Application and system users
      • Changing MongoDB options
      • Anti-affinity and tolerations
      • Labels and annotations
      • Exposing the cluster
      • Local storage support
      • Arbiter and non-voting nodes
      • MongoDB sharding
      • Transport encryption (TLS/SSL)
      • Data at rest encryption
      • Telemetry
        • About backups
        • Configure storage for backups
        • Making scheduled backups
        • Making on-demand backup
        • Storing operations logs for point-in-time recovery
        • Restore from a previously saved backup
        • Delete the unneeded backup
      • Upgrade MongoDB and the Operator
      • Horizontal and vertical scaling
      • Multi-cluster and multi-region deployment
      • Monitor with Percona Monitoring and Management (PMM)
        • Installing PMM Server
        • Installing PMM Client
      • Add sidecar containers
      • Restart or pause the cluster
      • Debug and troubleshoot
      • OpenLDAP integration
      • How to use private registry
      • Creating a private S3-compatible cloud for backups
      • Restore backup to a new Kubernetes-based environment
      • How to use backups to move the external database to Kubernetes
      • Install Percona Server for MongoDB in multi-namespace (cluster-wide) mode
      • Upgrading Percona Server for MongoDB manually
      • Custom Resource options
      • Percona certified images
      • Operator API
      • Frequently asked questions
      • Old releases (documentation archive)
      • Release notes index
      • Percona Operator for MongoDB 1.14.0 (2023-03-13)
      • Percona Operator for MongoDB 1.13.0 (2022-09-15)
      • Percona Operator for MongoDB 1.12.0 (2022-05-05)
      • Percona Distribution for MongoDB Operator 1.11.0 (2021-12-21)
      • Percona Distribution for MongoDB Operator 1.10.0 (2021-09-30)
      • Percona Distribution for MongoDB Operator 1.9.0 (2021-07-29)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.8.0 (2021-05-06)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.7.0 (2021-03-08)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.6.0 (2020-12-22)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.5.0 (2020-09-07)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.4.0 (2020-03-31)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.3.0 (2019-12-11)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.2.0 (2019-09-20)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.1.0 (2019-07-15)
      • Percona Kubernetes Operator for Percona Server for MongoDB 1.0.0 (2019-05-29)

    • Installing PMM Server
    • Installing PMM Client

    Monitoring¶

    Percona Monitoring and Management (PMM) provides an excellent solution of monitoring Percona Server for MongoDB.

    Note

    Only PMM 2.x versions are supported by the Operator.

    PMM is a client/server application. PMM Client runs on each node with the database you wish to monitor: it collects needed metrics and sends gathered data to PMM Server. As a user, you connect to PMM Server to see database metrics on a number of dashboards.

    That’s why PMM Server and PMM Client need to be installed separately.

    Installing PMM Server¶

    PMM Server runs as a Docker image, a virtual appliance, or on an AWS instance. Please refer to the official PMM documentation for the installation instructions.

    Installing PMM Client¶

    The following steps are needed for the PMM client installation in your Kubernetes-based environment:

    1. The PMM client installation is initiated by updating the pmm section in the deploy/cr.yaml file.

      • set pmm.enabled=true
      • set the pmm.serverHost key to your PMM Server hostname.
      • authorize PMM Client within PMM Server in one of two ways:

        Acquire the API Key from your PMM Server and set PMM_SERVER_API_KEY in the deploy/secrets.yaml secrets file to this obtained API Key value.

        check that the PMM_SERVER_USER key in the deploy/secrets.yaml secrets file contains your PMM Server user name (admin by default), and make sure the PMM_SERVER_PASSWORD key in the deploy/secrets.yaml secrets file contains the password specified for the PMM Server during its installation.

        Password-based authorization method is deprecated since the Operator 1.13.0.

        Note

        You use deploy/secrets.yaml file to create Secrets Object. The file contains all values for each key/value pair in a convenient plain text format. But the resulting Secrets contain passwords stored as base64-encoded strings. If you want to update password field, you’ll need to encode the value into base64 format. To do this, you can run echo -n "password" | base64 --wrap=0 (or just echo -n "password" | base64 in case of Apple macOS) in your local shell to get valid values. For example, setting the PMM Server API Key to new_key in the my-cluster-name-secrets object can be done with the following command:

        $ kubectl patch secret/my-cluster-name-secrets -p '{"data":{"PMM_SERVER_API_KEY": '$(echo -n new_key | base64 --wrap=0)'}}'
        
        $ kubectl patch secret/my-cluster-name-secrets -p '{"data":{"PMM_SERVER_API_KEY": '$(echo -n new_key | base64)'}}'
        

        Apply changes with the kubectl apply -f deploy/secrets.yaml command.

      • Starting from the Operator version 1.12.0, MongoDB operation profiling is disabled by default, and you should enable it to make PMM Query Analytics work. You can pass options to MongoDB in several ways, for example in the configuration subsection of the deploy/cr.yaml:

        spec:
          ...
          replsets:
            - name: rs0
              size: 3
              configuration: |
                operationProfiling:
                  slowOpThresholdMs: 200
                  mode: slowOp
                  rateLimit: 100
        
      • you can also use pmm.mongodParams and pmm.mongosParams keys to specify additional parameters for the pmm-admin add mongodb command for mongod and mongos Pods respectively, if needed.

        Note

        Please take into account that Operator automatically manages common MongoDB Service Monitoring parameters mentioned in the officiall pmm-admin add mongodb documentation, such like username, password, service-name, host, etc. Assigning values to these parameters is not recommended and can negatively affect the functionality of the PMM setup carried out by the Operator.

        When done, apply the edited deploy/cr.yaml file:

        $ kubectl apply -f deploy/cr.yaml
        
    2. Check that corresponding Pods are not in a cycle of stopping and restarting. This cycle occurs if there are errors on the previous steps:

      $ kubectl get pods
      $ kubectl logs my-cluster-name-rs0-0 -c pmm-client
      

    Contact Us

    For free technical help, visit the Percona Community Forum.

    To report bugs or submit feature requests, open a JIRA ticket.

    For paid support and managed or consulting services , contact Percona Sales.


    Last update: 2023-03-22
    Percona LLC and/or its affiliates, © 2009 - 2023
    Made with Material for MkDocs

    Cookie consent

    We use cookies to recognize your repeated visits and preferences, as well as to measure the effectiveness of our documentation and whether users find what they're searching for. With your consent, you're helping us to make our documentation better.