Skip to content

Instantly share code, notes, and snippets.

@drsnyder
Created August 20, 2015 17:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save drsnyder/3016efb02efebc6afbe6 to your computer and use it in GitHub Desktop.
Save drsnyder/3016efb02efebc6afbe6 to your computer and use it in GitHub Desktop.
Deregistering a service in consul
# deregistering
curl -v http://localhost:8500/v1/agent/service/deregister/discussion_8080
* About to connect() to localhost port 8500 (#0) [3/1857]
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8500 (#0)
> GET /v1/agent/service/deregister/discussion_8080 HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:8500
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Thu, 20 Aug 2015 16:57:45 GMT
< Content-Length: 0
< Content-Type: text/plain; charset=utf-8
<
curl -v -X PUT -d'{"CheckID": "service:discussion_8080", "ServiceID": "discussion_8080", "Node": "dev-broker", "Datacenter": "dev"}' http://localhost:8500/v1/catalog/deregister
* Connection #0 to host localhost left intact
* About to connect() to localhost port 8500 (#0)
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8500 (#0)
> PUT /v1/catalog/deregister HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:8500
> Accept: */*
> Content-Length: 117
> Content-Type: application/x-www-form-urlencoded
>
* upload completely sent off: 117 out of 117 bytes
< HTTP/1.1 200 OK
< Content-Type: application/json
< Date: Thu, 20 Aug 2015 16:57:45 GMT
< Content-Length: 4
<
* Connection #0 to host localhost left intact
true
# consul logs related to this SerivceID
Aug 20 16:57:40 dev-broker consul[2221]: agent: Service 'discussion_8080' in sync
Aug 20 16:57:40 dev-broker consul[2221]: agent: Check 'service:discussion_8080' in sync
Aug 20 16:57:40 dev-broker consul[2221]: agent: Check 'service:discussion_8080' status is now passing
Aug 20 16:57:40 dev-broker consul[2221]: agent: Service 'discussion_8080' in sync
Aug 20 16:57:40 dev-broker consul[2221]: agent: Check 'service:discussion_8080' in sync
Aug 20 16:57:40 dev-broker consul[2221]: http: Request /v1/agent/check/pass/service:discussion_8080 (779.028µs)
Aug 20 16:57:41 dev-broker consul[2221]: agent: Service 'discussion_8080' in sync
Aug 20 16:57:41 dev-broker consul[2221]: agent: Check 'service:discussion_8080' in sync
Aug 20 16:57:41 dev-broker consul[2221]: agent: Service 'discussion_8080' in sync
Aug 20 16:57:41 dev-broker consul[2221]: agent: Check 'service:discussion_8080' in sync
Aug 20 16:57:42 dev-broker consul[2221]: agent: Check 'service:discussion_8080' status is now passing
Aug 20 16:57:42 dev-broker consul[2221]: agent: Service 'discussion_8080' in sync
Aug 20 16:57:42 dev-broker consul[2221]: agent: Check 'service:discussion_8080' in sync
Aug 20 16:57:42 dev-broker consul[2221]: http: Request /v1/agent/check/pass/service:discussion_8080 (1.496063ms)
Aug 20 16:57:43 dev-broker consul[2221]: agent: Service 'discussion_8080' in sync
Aug 20 16:57:43 dev-broker consul[2221]: agent: Check 'service:discussion_8080' in sync
Aug 20 16:57:43 dev-broker consul[2221]: agent: Check 'service:discussion_8080' status is now passing
Aug 20 16:57:43 dev-broker consul[2221]: agent: Service 'discussion_8080' in sync
Aug 20 16:57:43 dev-broker consul[2221]: agent: Check 'service:discussion_8080' in sync
Aug 20 16:57:43 dev-broker consul[2221]: http: Request /v1/agent/check/pass/service:discussion_8080 (963.795µs)
Aug 20 16:57:44 dev-broker consul[2221]: agent: Service 'discussion_8080' in sync
Aug 20 16:57:44 dev-broker consul[2221]: agent: Check 'service:discussion_8080' in sync
Aug 20 16:57:44 dev-broker consul[2221]: agent: Check 'service:discussion_8080' status is now passing
Aug 20 16:57:44 dev-broker consul[2221]: agent: Service 'discussion_8080' in sync
Aug 20 16:57:44 dev-broker consul[2221]: agent: Check 'service:discussion_8080' in sync
Aug 20 16:57:44 dev-broker consul[2221]: http: Request /v1/agent/check/pass/service:discussion_8080 (1.997348ms)
Aug 20 16:57:45 dev-broker consul[2221]: agent: Deregistered service 'discussion_8080'
Aug 20 16:57:45 dev-broker consul[2221]: agent: Check 'service:discussion_8080' in sync
Aug 20 16:57:45 dev-broker consul[2221]: agent: Deregistered check 'service:discussion_8080'
Aug 20 16:57:45 dev-broker consul[2221]: http: Request /v1/agent/service/deregister/discussion_8080 (19.73968ms)
Aug 20 16:57:46 dev-broker consul[2221]: http: Request /v1/agent/check/pass/service:discussion_8080, error: CheckID does not have associated TTL
Aug 20 16:57:46 dev-broker consul[2221]: http: Request /v1/agent/check/pass/service:discussion_8080 (246.298µs)
Aug 20 16:57:47 dev-broker consul[2221]: agent: Synced service 'discussion_8080'
Aug 20 16:57:47 dev-broker consul[2221]: agent: Check 'service:discussion_8080' in sync
Aug 20 16:57:47 dev-broker consul[2221]: agent: Service 'discussion_8080' in sync
Aug 20 16:57:47 dev-broker consul[2221]: agent: Check 'service:discussion_8080' in sync
Aug 20 16:57:48 dev-broker consul[2221]: agent: Service 'discussion_8080' in sync
Aug 20 16:57:48 dev-broker consul[2221]: agent: Check 'service:discussion_8080' in sync
Aug 20 16:57:49 dev-broker consul[2221]: agent: Check 'service:discussion_8080' missed TTL, is now critical
Aug 20 16:57:50 dev-broker consul[2221]: agent: Service 'discussion_8080' in sync
Aug 20 16:57:50 dev-broker consul[2221]: agent: Check 'service:discussion_8080' in sync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment