ES OOM alignment 29/33129/1
authorYuli Shlosberg <ys9693@att.com>
Tue, 27 Feb 2018 08:38:48 +0000 (10:38 +0200)
committerYuli Shlosberg <ys9693@att.com>
Tue, 27 Feb 2018 08:39:13 +0000 (10:39 +0200)
Change-Id: I2f9321dcd9603cbb38d840efe9dc46fb0772e785
Issue-ID: SDC-915
Signed-off-by: Yuli Shlosberg <ys9693@att.com>
catalog-be/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/ready-probe.sh.erb
sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/recipes/03-prepareProbeFile.rb
sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/ready-probe.sh.erb
sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/recipes/ES_3_prepareProbeFile.rb [new file with mode: 0644]
sdc-os-chef/sdc-elasticsearch/chef-repo/cookbooks/sdc-elasticsearch/templates/default/ready-probe.sh.erb [new file with mode: 0644]
sdc-os-chef/sdc-elasticsearch/chef-solo/roles/elasticsearch.json

index 26f7266..4d8540e 100644 (file)
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-set -x
-
 health_Check_http_code=$(curl --max-time 5 -o /dev/null -w '%{http_code}' http://127.0.0.1:8080/sdc2/rest/healthCheck)
 if [[ "$health_Check_http_code" -eq 500 ]]; then
    exit 200
index 3d72202..c196ca7 100644 (file)
@@ -14,11 +14,4 @@ template "/var/lib/ready-probe.sh" do
      :cassandra_ip => application_host,
      :cassandra_pwd => ENV['CS_PASSWORD']
   })
-end
-
-
-bash "run_probe_script" do
-   code <<-EOH
-     /var/lib/ready-probe.sh
-   EOH
 end
\ No newline at end of file
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 (file)
index 0000000..14d08be
--- /dev/null
@@ -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 (file)
index 0000000..66b0787
--- /dev/null
@@ -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
index 239c1cd..8e11b22 100644 (file)
@@ -11,7 +11,8 @@
   "chef_type": "role",
   "run_list": [
     "recipe[sdc-elasticsearch::ES_1_setup_elasticsearch]",
-    "recipe[sdc-elasticsearch::ES_2_setup_logging]"
+    "recipe[sdc-elasticsearch::ES_2_setup_logging]",
+    "recipe[sdc-elasticsearch::ES_3_prepareProbeFile]"
   ],
   "env_run_lists": {
   }