Skip to content

Commit

Permalink
Check the status of Cassandra's binary interface and wait up to 60 se…
Browse files Browse the repository at this point in the history
…conds for the server to start before proceeding with the build.

(cherry picked from commit 2b50827)
Signed-off-by: Stefan Negrea <snegrea@redhat.com>
  • Loading branch information
Stefan Negrea committed Oct 25, 2016
1 parent 4a365aa commit a6d0f37
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .travis.install.cassandra.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,16 @@ export HEAP_NEWSIZE="100M"
export MAX_HEAP_SIZE="1G"

nohup sh ${CASSANDRA_HOME}/bin/cassandra -f -p ${HOME}/cassandra.pid > ${CASSANDRA_HOME}/logs/stdout.log 2>&1 &


CASSANDRA_STATUS="undecided"
TOTAL_WAIT=0;
while [ "$CASSANDRA_STATUS" != "running" ] && [ $TOTAL_WAIT -lt 60 ]; do
CASSANDRA_STATUS=`${CASSANDRA_HOME}/bin/nodetool statusbinary | xargs`
echo "Cassandra server status: $CASSANDRA_STATUS."

sleep 3

TOTAL_WAIT=$((TOTAL_WAIT+3))
echo "Waited $TOTAL_WAIT seconds for Cassandra to start."
done

0 comments on commit a6d0f37

Please sign in to comment.