Not the answer you need?
Register and ask your own question!

PMM add/remove mysql instances

StaterosStateros ContributorCurrent User Role Patron
Hello all!

I use PMM version 1.1.1 with percona-server-5.5.
My idea is to make registration and deletion new DB slaves from pmm monitoring automaticly.

With registration no problem. Each time when slave have created I added it to PMM with unique name.

But when I want to terminate some instance, AWS do it, and I see in PMM many ghost instances. Is there any possiable to clean up those ghost instances from server side (instance which was under monitoring terminated already)?

Also when I use `pmm-admin remove --all` can I cleanup historical metrics?

Comments

  • Michael CoburnMichael Coburn Principal Architect, Percona Percona Staff Role
    Stateros wrote: »
    Is there any possiable to clean up those ghost instances from server side (instance which was under monitoring terminated already)?
    Also when I use `pmm-admin remove --all` can I cleanup historical metrics?
    The option to remove records from Prometheus is:
    pmm-admin purge mysql:metrics <instanceName>
    
  • StaterosStateros Contributor Current User Role Patron
    Thank you. Can I use this command from another instance where pmm-client instaled?
    For example I have instance A and instance B. B was terminated. Can I call from A?
    pmm-admin purge mysql:metrics B
    
  • MykolaMykola Percona Percona Staff Role
    I see in PMM many ghost instances
    Do we speak about query analytics interface or Grafana?
  • StaterosStateros Contributor Current User Role Patron
    Grafana only
  • MykolaMykola Percona Percona Staff Role
    Grafana uses data from Prometheus, Prometheus use Consul to get info about nodes.
    Consul developers removed "Deregister" button from Consul interface :(
    https://github.com/hashicorp/consul/issues/2541

    but it is possible to deregister via Consul API call
    to get list of nodes:
    curl -s 'http://USER:PASSWORD&#64;PMM-SERVER-IP/v1/internal/ui/nodes?dc=dc1' | python -mjson.tool | less
    
    remove node from consul
    curl -s -X PUT -d '{"Datacenter":"dc1","Node":"NODE-NAME"}' 'http://USER:PASSWORD&#64;PMM-SERVER-IP/v1/catalog/deregister?dc=dc1'
    

    after that, it is needed to remove data from Prometheus (or just wait for some time, up to one day)
    curl -X DELETE 'http://USER:PASSWORD&#64;PMM-SERVER-IP/prometheus/api/v1/series?match\[\]=\{instance="NODE-NAME"\}'
    
    please note that node names in consul and in prometheus can be different for the one host

    NB: we are going to add Deregister button on our interface in PMM-544
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.