summaryrefslogtreecommitdiffstats
path: root/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks
diff options
context:
space:
mode:
authorYuli Shlosberg <ys9693@att.com>2018-02-27 10:38:48 +0200
committerYuli Shlosberg <ys9693@att.com>2018-02-27 10:39:13 +0200
commitc120666439c6eee238e31a01ee9de91d1fa821f8 (patch)
treea904c794b42779ad2f292eb82f9e774adddfffd2 /sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks
parente74faa5a396139e34678ff73f60c6038201ca409 (diff)
ES OOM alignment
Change-Id: I2f9321dcd9603cbb38d840efe9dc46fb0772e785 Issue-ID: SDC-915 Signed-off-by: Yuli Shlosberg <ys9693@att.com>
Diffstat (limited to 'sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks')
-rw-r--r--sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/recipes/ES_3_prepareProbeFile.rb5
-rw-r--r--sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/templates/default/ready-probe.sh.erb8
2 files changed, 13 insertions, 0 deletions
diff --git a/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/recipes/ES_3_prepareProbeFile.rb b/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/recipes/ES_3_prepareProbeFile.rb
new file mode 100644
index 0000000000..14d08be94c
--- /dev/null
+++ b/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/recipes/ES_3_prepareProbeFile.rb
@@ -0,0 +1,5 @@
+template "/var/lib/ready-probe.sh" do
+ source "ready-probe.sh.erb"
+ sensitive true
+ mode 0755
+end \ No newline at end of file
diff --git a/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/templates/default/ready-probe.sh.erb b/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/templates/default/ready-probe.sh.erb
new file mode 100644
index 0000000000..66b07873e5
--- /dev/null
+++ b/sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/templates/default/ready-probe.sh.erb
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+health_Check_http_code=$(curl -o /dev/null -w '%{http_code}' http://127.0.0.1:9200/_cluster/health?wait_for_status=yellow&timeout=120s)
+if [[ "$health_Check_http_code" -eq 200 ]]; then
+ exit 200
+else
+ exit $health_Check_http_code
+fi