Skip to content

Commit

Permalink
Allow disabling elasticsearch post-start script
Browse files Browse the repository at this point in the history
  • Loading branch information
Infra-Red committed Apr 4, 2017
1 parent 7c23f48 commit 7cb551e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jobs/elasticsearch/spec
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,6 @@ properties:
elasticsearch.http_host:
description: "The host address to bind the elasticsearch HTTP service to and to publish for HTTP clients to connect to"
default: 0.0.0.0
elasticsearch.health.disable_post_start:
description: Allow node to run post-start script? (true / false)
default: false
8 changes: 8 additions & 0 deletions jobs/elasticsearch/templates/bin/post-start.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -e

<% if !p("elasticsearch.health.disable_post_start") %>

echo "Waiting 1m for elasticsearch to accept connections..."
n=0
until [ $n -ge 12 ]
Expand Down Expand Up @@ -59,3 +61,9 @@ fi
curl -X PUT -s localhost:9200/_all/_settings \
-d '{"settings": {"index.unassigned.node_left.delayed_timeout": "<%= p("elasticsearch.recovery.delay_allocation") %>"}}'
<% end %>

<% else %>

echo "Disable post start script property is set to <%= p("elasticsearch.health.disable_post_start") %>. Skipping post-start..."

<% end %>

0 comments on commit 7cb551e

Please sign in to comment.