qan does not remove or stop individual servers

Monitoring queries is such a great feature and I really like it. That said it can be clunky to admin. I am on RDS, which means that it can be easy to add instances but deleting QAN for instances about to be decommissioned is challenging. I took notes. Tried many things and eventually found the UUID associated with the QAN and removed it. Here’s the details:

pmm-admin Info
pmm-admin 1.2.0 (both server & client)

I did the following

  1. pmm-admin stop mysql:queries myrds2
  2. pmm-admin list shows ALL mysql:queries had stopped, including my main RDS.
  3. pmm-admin start mysql:queries myrds1
  4. pmm-admin list shows ALL mysql:queries had started, including myrds2.
  5. I again stopped mysql:queries : pmm-admin stop mysql:queries
  6. ran pmm-admin remove mysql:queries myrds2
  7. pmm-admin start mysql:queries myrds1 and mysql:queries myrds2 was STILL listed.
    8… systemctl stop pmm-mysql-queries-0
  8. systemctl start pmm-mysql-queries-0
  9. pmm-admin list show ALL mysql:queries had started, including myrds2.
  10. went into PMM queries & the drop down showed me the UUID of myrds2.
  11. pmm-admin stop mysql:queries
  12. systemctl stop pmm-mysql-queries-0
    14 sudo rm /usr/local/percona/qan-agent/instance/json
    15 ran systemctl start pmm-mysql-queries-0
  13. pmm-admin start mysql:queries
  14. pmm-admin list showed that the myrds2 was no longer in the list.

I had to remove the .json from the qan-agent/instances to get that RDS instance to stop collecting queries. I found that my running a find for the qan UUID on the instance I wanted to go away. Seems like remove should remove that UUID or at least change the name so it won’t be used by qan.

I’m putting this here incase someone else is having similar problems.

erino thank you!

also can be useful this instruction: [LIST=1]
[]Get list of nodes from Consul
curl -s ‘http://USER:PASSWORD@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@PMM-SERVER-IP/v1/catalog/deregister?dc=dc1’
[]Remove data from Prometheus
curl -X DELETE ‘http://USER:PASSWORD@PMM-SERVER-IP/prometheus/api/v1/series?match[]={instance=“NODE-NAME”}’
[
]Get UUID for node from QAN - select node in QAN dropdown, and copy-paste node UUID from the URL:
[url]http://PMM-SERVER-IP/qan/#/instance/46c294490cd4417e685d22196496a777/begin/2017-01-19T19:47:24/end/2017-01-19T20:47:24/[/url]
[*]Remove data from QAN:
curl -X “DELETE” ‘http://PMM-SERVER-IP/qan-api/instances/46c294490cd4417e685d22196496a777
[/LIST]
Please note that node names in consul and in prometheus can be different for the one host

NB: we know that it is needed to have user-friendly solution, and we are working on it - [url][PMM-544] Agents, Services and Nodes can now be removed via the 'PMM Inventory' page - Percona JIRA
feel free to add any information directly to the ticket.

The above instructions do not work for 1.17.1:

  1. works
  2. works
  3. {“status”:“error”,“errorType”:“internal”,“error”:“not implemented”}
  4. There is no UUID in the URL.