Permalink
Browse files

Fixed https://cloudifysource.atlassian.net/browse/RECIPES-4

  • Loading branch information...
Tamir Korem
Tamir Korem committed Feb 24, 2013
1 parent 432578e commit cd9dc8abc2c48c0c0e7106f230f9e25f43c7fbcc
Showing with 15 additions and 0 deletions.
  1. +15 −0 services/mysql/mysql_startDetection.groovy
@@ -61,6 +61,21 @@ println "mysql_startDetection.groovy: jdbcPort is ${config.jdbcPort} ..."
if ( ServiceUtils.isPortOccupied(config.jdbcPort) ) {
println "mysql_startDetection: port ${config.jdbcPort} is now occupied ..."
if ( config.startDetectionQuery.length() == 0 ) {
+ if ( config.masterSlaveMode ) {
+ def iAmMaster = context.attributes.thisInstance["isMaster"]
+ println "mysql_startDetection: iAmMaster is ${iAmMaster}..."
+ if ( iAmMaster ) {
+ if (checkMasterStatus(context,config)) {
+ println "mysql_startDetection: Master is ready"
+ context.attributes.thisService["masterIsReady"]=true
+ System.exit(0)
+ }
+ else {
+ println "mysql_startDetection: Master is NOT ready yet..."
+ System.exit(-1)
+ }
+ }
+ }
println "mysql_startDetection: startDetectionQuery is empty - service is up "
System.exit(0)
}

0 comments on commit cd9dc8a

Please sign in to comment.