Uploaded image for project: 'Percona Monitoring and Management'
  1. Percona Monitoring and Management
  2. PMM-3002

pmm-admin config can be run multiple times with different servers

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: PMM Client
    • Labels:

      Description

      Problem:

      There are currently no checks when using:

      pmm-admin config --server ... 

      If we decide to do the following, it will continue to work, and both pmm-server servers will get the scraped data:

      [root@pmm-2 ~]# pmm-admin config --server 192.168.87.2
      OK, PMM server is alive.
      
      PMM Server | 192.168.87.2
      Client Name | pmm-2
      Client Address | 192.168.87.3
      
      [root@pmm-2 ~]# pmm-admin add mysql
      [linux:metrics] OK, now monitoring this system.
      [mysql:metrics] OK, now monitoring MySQL metrics using DSN root:***@tcp(localhost:3306)
      [mysql:queries] OK, now monitoring MySQL queries from slowlog using DSN root:***@tcp(localhost:3306)
      
      [root@pmm-2 ~]# pmm-admin config --server 192.168.87.4
      OK, PMM server is alive.
      
      PMM Server | 192.168.87.4
      Client Name | pmm-2
      Client Address | 192.168.87.3
      
      [root@pmm-2 ~]# pmm-admin list
      We have found system services disconnected from PMM server.
      Usually, this happens when data container is wiped before all monitoring services are removed or client is uninstalled.
      
      Orphaned local services: pmm-linux-metrics-42000, pmm-mysql-metrics-42002, pmm-mysql-queries-0
      
      To continue, run 'pmm-admin repair' to remove orphaned services.
      
      [root@pmm-2 ~]# pmm-admin repair
      OK, removed 3 orphaned services.
      
      [root@pmm-2 ~]# pmm-admin list
      pmm-admin 1.14.1
      
      PMM Server | 192.168.87.4
      Client Name | pmm-2
      Client Address | 192.168.87.3
      Service Manager | linux-systemd
      
      No monitoring registered for this node identified as 'pmm-2'.
      
      [root@pmm-2 ~]# pmm-admin add mysql
      [linux:metrics] OK, now monitoring this system.
      [mysql:metrics] OK, now monitoring MySQL metrics using DSN root:***@tcp(localhost:3306)
      [mysql:queries] OK, now monitoring MySQL queries from slowlog using DSN root:***@tcp(localhost:3306)
      

      In this example, just to be more clear, we did:

        1- pmm-admin config --server pmm-server-1

        2- then added some metrics

        3- pmm-admin config --server pmm-server-2

        4- repaired the services, and re-added them

       

      After doing this, the result is that we see metrics in both pmm-server-1 (192.168.87.2) and in pmm-server-2 (192.168.87.4), which is very confusing.

      Latest version 1.14.1 used on both pmm-server and pmm-client for the tests.

      Proposed fix:

      If the pmm-client is already bound to a server, deny reconfiguring it to point to another one unless `pmm-admin uninstall` is run before. When uninstall is run in the client, make sure to delete all preexisting information about which server it was pointing to, and make sure that the client node is not scraped anymore from the pmm-server in question.

       

        Smart Checklist

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                agustin.gallego Agustín Gallego
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: