Remove unused servers from PMM

We recently decommissioned some unused Mysql servers. Part of this process involved removing the nodes from Percona Monitoring and Management (PMM). I found that although this process is very simple overall, it is not every intuitive. The process is as follows:

1) Find node name:
curl -s 'http://<strong>pmm-hostname.domain.com</strong>/v1/internal/ui/nodes?dc=dc1' | python -mjson.tool

2) Remove node from consul:
curl -s -X PUT -d '{"Datacenter":"dc1","Node":"<strong>node_name</strong>"}' 'http://<strong>pmm-hostname.domain.com</strong>/v1/catalog/deregister?dc=dc1'

3) Remove node from prometheus:
curl -X DELETE 'http://<strong>pmm-hostname.domain.com</strong>/prometheus/api/v1/series?match\[\]=\{instance="<strong>node_name</strong>"\}'

Leave a Reply

Your email address will not be published. Required fields are marked *