Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Add optional http health check for elasticsearch. #35

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions jobs/elasticsearch/monit
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
<% if p("elasticsearch.monitor.type") == "process" %>
check process elasticsearch
with pidfile /var/vcap/sys/run/elasticsearch/elasticsearch.pid
start program "/var/vcap/jobs/elasticsearch/bin/monit_debugger elasticsearch_ctl '/var/vcap/jobs/elasticsearch/bin/elasticsearch_ctl start'" with timeout 120 seconds
stop program "/var/vcap/jobs/elasticsearch/bin/monit_debugger elasticsearch_ctl '/var/vcap/jobs/elasticsearch/bin/elasticsearch_ctl stop'"
group vcap
<% elsif p("elasticsearch.monitor.type") == "host" %>
check host elasticsearch with address 127.0.0.1
start program "/var/vcap/jobs/elasticsearch/bin/monit_debugger elasticsearch_ctl '/var/vcap/jobs/elasticsearch/bin/elasticsearch_ctl start'" with timeout 120 seconds
stop program "/var/vcap/jobs/elasticsearch/bin/monit_debugger elasticsearch_ctl '/var/vcap/jobs/elasticsearch/bin/elasticsearch_ctl stop'"
if failed url http://127.0.0.1:9200/_cluster/health
<% if p("elasticsearch.node.allow_data") and not p("elasticsearch.node.allow_master") %>and content = '"status":"green"'<% end %>
timeout <%= p("elasticsearch.monitor.host_timeout") %> seconds
for <%= p("elasticsearch.monitor.host_cycles") %> cycles
then stop
group vcap
<% end %>

check device elasticsearch-ephemeral_disk with path /var/vcap/data
if SPACE usage > 80% then alert
Expand Down
9 changes: 9 additions & 0 deletions jobs/elasticsearch/spec
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ properties:
elasticsearch.limits.fd:
description: Maximum file descriptors
default: 65536
elasticsearch.monitor.type:
description: Monit check type; must be "process" or "host"
default: process
elasticsearch.monitor.host_timeout:
description: Host check timeout, in seconds
default: 15
elasticsearch.monitor.host_cycles:
description: Host check cycles
default: 5
elasticsearch.discovery.minimum_master_nodes:
description: The minimum number of master eligible nodes a node should "see" in order to operate within the cluster. Recommended to set it to a higher value than 1 when running more than 2 nodes in the cluster.
default: 1
Expand Down