Wait for all cassandra dbs are up before starting analytics services
Change-Id: I98aad8bb081a16584688df990410691ce03abfce
Related-PROD: PROD-32988
diff --git a/restore-cassandra.groovy b/restore-cassandra.groovy
index 7285c40..f1964ab 100644
--- a/restore-cassandra.groovy
+++ b/restore-cassandra.groovy
@@ -91,8 +91,11 @@
common.errorMsg('An error has been occurred during cassandra db startup on I@opencontrail:control and not I@cassandra:backup:client nodes: ' + err.getMessage())
throw err
}
- // another mantra, wait till all services are up
- sleep(60)
+ // wait till outstanding cassandra dbs are up
+ common.retry(6, 20){
+ common.infoMsg("Trying to connect to casandra db on I@opencontrail:control and not I@cassandra:backup:client nodes ...")
+ salt.cmdRun(pepperEnv, 'I@opencontrail:control and not I@cassandra:backup:client', "nc -v -z -w2 ${configDbIp} ${configDbPort}")
+ }
try {
common.infoMsg("Start analytics containers node")
salt.cmdRun(pepperEnv, 'I@opencontrail:collector', 'cd /etc/docker/compose/opencontrail/; docker-compose up -d')