diff --git a/jobs/elasticsearch/spec b/jobs/elasticsearch/spec index 40ca6edd..f7f6b796 100644 --- a/jobs/elasticsearch/spec +++ b/jobs/elasticsearch/spec @@ -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 diff --git a/jobs/elasticsearch/templates/bin/post-start.erb b/jobs/elasticsearch/templates/bin/post-start.erb index 18eca376..0a05ede1 100755 --- a/jobs/elasticsearch/templates/bin/post-start.erb +++ b/jobs/elasticsearch/templates/bin/post-start.erb @@ -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 ] @@ -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 %>