#!/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
: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
#!/bin/bash
-set -x
-
CASSANDRA_PASS=<%= @cassandra_pwd %>
CASSANDRA_IP=<%= @cassandra_ip %>
--- /dev/null
+template "/var/lib/ready-probe.sh" do
+ source "ready-probe.sh.erb"
+ sensitive true
+ mode 0755
+end
\ No newline at end of file
--- /dev/null
+#!/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
"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": {
}