mirror of
https://github.com/status-im/consul.git
synced 2025-01-11 14:24:39 +00:00
Update checks.html.md
This commit is contained in:
parent
5131201736
commit
584a136906
@ -26,18 +26,19 @@ appropriate calls to the [HTTP API](/api/health.html).
|
|||||||
We will use the check definition approach because, just like with
|
We will use the check definition approach because, just like with
|
||||||
services, definitions are the most common way to set up checks.
|
services, definitions are the most common way to set up checks.
|
||||||
|
|
||||||
In Consul 0.9.0 and later the agent must be configured with enable_script_checks set to true in order to enable script checks.
|
In Consul 0.9.0 and later the agent must be configured with
|
||||||
|
`enable_script_checks` set to true in order to enable script checks.
|
||||||
|
|
||||||
Create two definition files in the Consul configuration directory of
|
Create two definition files in the Consul configuration directory of
|
||||||
the second node:
|
the second node:
|
||||||
|
|
||||||
```text
|
```text
|
||||||
vagrant@n2:~$ echo '{"check": {"name": "ping",
|
vagrant@n2:~$ echo '{"check": {"name": "ping",
|
||||||
"args": ["ping","-c1","google.com",">/dev/null"], "interval": "30s"}}' \
|
"args": ["ping", "-c1", "google.com"], "interval": "30s"}}' \
|
||||||
>/etc/consul.d/ping.json
|
>/etc/consul.d/ping.json
|
||||||
|
|
||||||
vagrant@n2:~$ echo '{"service": {"name": "web", "tags": ["rails"], "port": 80,
|
vagrant@n2:~$ echo '{"service": {"name": "web", "tags": ["rails"], "port": 80,
|
||||||
"check": {"args": ["curl","localhost",">/dev/null","2>&1"], "interval": "10s"}}}' \
|
"check": {"args": ["curl", "localhost"], "interval": "10s"}}}' \
|
||||||
>/etc/consul.d/web.json
|
>/etc/consul.d/web.json
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user