mirror of
https://github.com/status-im/consul.git
synced 2025-01-13 23:36:00 +00:00
Update documentation for service definition
This commit is contained in:
parent
66fd8fb2a0
commit
4caf049c4c
@ -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",
|
||||
@ -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
|
||||
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user