diff --git a/.ci/setup_cassandra.sh b/.ci/setup_cassandra.sh index de57890592a6..6b81db4003b1 100644 --- a/.ci/setup_cassandra.sh +++ b/.ci/setup_cassandra.sh @@ -2,6 +2,18 @@ CASSANDRA_BASE=apache-cassandra-$CASSANDRA_VERSION -sudo rm -rf /var/lib/cassandra/* -curl http://apache.arvixe.com/cassandra/$CASSANDRA_VERSION/$CASSANDRA_BASE-bin.tar.gz | tar xz +n=0 +until [ $n -ge 5 ] +do + sudo rm -rf /var/lib/cassandra/* + curl http://apache.arvixe.com/cassandra/$CASSANDRA_VERSION/$CASSANDRA_BASE-bin.tar.gz | tar xz && break + n=$[$n+1] + sleep 5 +done + +if [[ ! -f $CASSANDRA_BASE/bin/cassandra ]] ; then + echo 'Failed downloading and unpacking cassandra. Aborting.' + exit 1 +fi + sudo sh $CASSANDRA_BASE/bin/cassandra