diff options
author | Yuli Shlosberg <ys9693@att.com> | 2018-01-25 13:53:36 +0200 |
---|---|---|
committer | Michael Lando <ml636r@att.com> | 2018-02-04 10:39:20 +0000 |
commit | 0875ce0faad191c21b32cc9c95ffc20ebd57d586 (patch) | |
tree | 28520da212637e0f67697d9ff837e80da6eaa408 /sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/ready-probe.sh.erb | |
parent | b676b6dcada5549348003191c09142e92de4d352 (diff) |
Cassandra OOM Alignment
Change-Id: If9792919dba17936965b45361888a44a12a76b67
Issue-ID: SDC-911
Signed-off-by: Yuli Shlosberg <ys9693@att.com>
Diffstat (limited to 'sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/ready-probe.sh.erb')
-rw-r--r-- | sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/ready-probe.sh.erb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/ready-probe.sh.erb b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/ready-probe.sh.erb new file mode 100644 index 0000000000..2f97d0768e --- /dev/null +++ b/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/templates/default/ready-probe.sh.erb @@ -0,0 +1,16 @@ +#!/bin/bash + +CASSANDRA_PASS=<%= @cassandra_pwd %> +CASSANDRA_IP=<%= @cassandra_ip %> + +if [[ $(nodetool status |tail -n2 | grep -Ev "^$"a) == *"UN"* ]]; then + echo "exit" | cqlsh -u cassandra -p $CASSANDRA_PASS $CASSANDRA_IP > /dev/null 2>&1 + rc=$? + if [[ $rc != 0 ]]; then exit $rc; fi + fi + exit 0; +else + echo "Not Up"; + exit 1; +fi + |