Skip to content

Commit

Permalink
Check the status of Cassandra's binary interface and wait up to 30 se…
Browse files Browse the repository at this point in the history
…conds for the server to start before proceeding with the build.
  • Loading branch information
Stefan Negrea committed Oct 25, 2016
1 parent a5d8b76 commit 8d46cba
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 30 ]; 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 8d46cba

Please sign in to comment.