def start_cassandra(db_ips, db_master, keyname):
 logging.info('Starting Cassandra...')
 for ip in db_ips:
  init_config = '{script} --local-ip {ip} --master-ip {db_master}'.format(script=SETUP_CASSANDRA_SCRIPT, ip=ip, db_master=db_master)
  try:
   utils.ssh(ip, keyname, init_config)
  except subprocess.CalledProcessError:
   message = 'Unable to configure Cassandra on {}'.format(ip)
   logging.exception(message)
   raise dbconstants.AppScaleDBError(message)
  try:
   start_service_cmd = (START_SERVICE_SCRIPT + CASSANDRA_WATCH_NAME)
   utils.ssh(ip, keyname, start_service_cmd)
  except subprocess.CalledProcessError:
   message = 'Unable to start Cassandra on {}'.format(ip)
   logging.exception(message)
   raise dbconstants.AppScaleDBError(message)
 logging.info('Waiting for Cassandra to be ready')
 status_cmd = '{} status'.format(cassandra_interface.NODE_TOOL)
 while (utils.ssh(db_master, keyname, status_cmd, method=subprocess.call) != 0):
  time.sleep(5)
 logging.info('Successfully started Cassandra.')

def start_cassandra ( db_ips , db_master , keyname ) : logging . info ( 'Starting Cassandra...' ) for ip in db_ips : init_config = '{script} --local-ip {ip} --master-ip {db_master}' . format ( script = SETUP_CASSANDRA_SCRIPT , ip = ip , db_master = db_master ) try : utils . ssh ( ip , keyname , init_config ) except subprocess . CalledProcessError : message = 'Unable to configure Cassandra on {}' . format ( ip ) logging . exception ( message ) raise dbconstants . AppScaleDBError ( message ) try : start_service_cmd = ( START_SERVICE_SCRIPT + CASSANDRA_WATCH_NAME ) utils . ssh ( ip , keyname , start_service_cmd ) except subprocess . CalledProcessError : message = 'Unable to start Cassandra on {}' . format ( ip ) logging . exception ( message ) raise dbconstants . AppScaleDBError ( message ) logging . info ( 'Waiting for Cassandra to be ready' ) status_cmd = '{} status' . format ( cassandra_interface . NODE_TOOL ) while ( utils . ssh ( db_master , keyname , status_cmd , method = subprocess . call ) != 0 ) : time . sleep ( 5 ) logging . info ( 'Successfully started Cassandra.' )
creates a monit configuration file and prompts monit to start cassandra .