I am trying to remove some services that were added to consul manually via a json file. I have tried to run both of these commands with no success. I need a way to purge these values. Please if you can help I would be very greatful.
Brad
consul services deregister service_registration.json
and
consul services deregister -id=grafana
The cli shows being deregistered but when I go to look in the ui, they are still there. And when I go to try to register the corrected version, it adds it to the existing service that I am trying correct.
This is the broken one I am trying to replace.
{
"services": [
{
"id": "grafana",
"name": "grafana_vpc",
"tags": [
"primary"
],
"address": "10.10.10.2",
"port": 8600,
"check": {
"id": "grafana",
"name": "Consul DNS tcp on port 8600",
"tcp": "10.10.10.2:8600",
"interval": "10s",
"timeout": "1s"
}
}
]
}
This is the corrected one.
{
"services": [
{
"id": "grafana",
"name": "grafana_vpc",
"tags": [
"primary"
],
"address": "10.10.10.2",
"port": 3000,
"check": {
"id": "grafana",
"name": "Consul DNS tcp on port 53",
"tcp": "10.10.10.2:53",
"interval": "10s",
"timeout": "1s"
}
}
]
}