Skip to content

Commit

Permalink
Update documentation for service definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Shawn Cook committed Sep 11, 2015
1 parent 66fd8fb commit 4caf049
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions website/source/docs/agent/services.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ A service definition that is a script looks like:
"tags": ["master"],
"address": "127.0.0.1",
"port": 8000,
"enableTagOverride": false,
"checks": [
{
"script": "/usr/local/bin/check_redis.py",
Expand All @@ -37,9 +38,9 @@ A service definition that is a script looks like:
```

A service definition must include a `name` and may optionally provide
an `id`, `tags`, `address`, `port`, and `check`. The `id` is set to the `name` if not
provided. It is required that all services have a unique ID per node, so if names
might conflict then unique IDs should be provided.
an `id`, `tags`, `address`, `port`, `check`, and `enableTagOverride`. The `id` is
set to the `name` if not provided. It is required that all services have a unique
ID per node, so if names might conflict then unique IDs should be provided.

The `tags` property is a list of values that are opaque to Consul but can be used to
distinguish between "master" or "slave" nodes, different versions, or any other service
Expand Down Expand Up @@ -73,6 +74,24 @@ from `1`.

Note: there is more information about [checks here](/docs/agent/checks.html).

The `enableTagOverride` can optionally specified to disable the antientropy feature for
this service. If `enableTagOverride` is set to TRUE then external agents can
reregister this service and modify the tags. Subsequent local sync operations
by this agent will ignore the updated tags. For instance: If an external agent
modified both the tags and the port for this service and `enableTagOverride`
was set to TRUE then after the next sync cycle the service's port would revert
to the original value but the tags would maintain the updated value. As a
counter example: If an external agent modified both the tags and port for this
service and `enableTagOverride` was set to FALSE then after the next sync
cycle the service's port AND the tags would revert to the original value and
all modifications would be lost. It's important to note that this applies only
to the locally registered service. If you have multiple nodes all registering
the same service their `enableTagOverride` configuration and all other service
configuration items are independant of one another. Updating the tags for
the service registered on one node is independant of the same service (by name)
registered on another node. If `enableTagOverride` is not specified the default
value is false.

To configure a service, either provide it as a `-config-file` option to the
agent or place it inside the `-config-dir` of the agent. The file must
end in the ".json" extension to be loaded by Consul. Check definitions can
Expand Down

0 comments on commit 4caf049

Please sign in to comment.