Esempio n. 1
0
def _deploy_cassandra_build(bin, cassandra_local_tar, cassandra_version, datacenter, realm='*', region="us-east-1", seeds='', verbose=False, project = "bloomstore", roleval = "backend"):
  """ Deploy the customed built cassandra binary to a temp folder. """
  sudo("chown -R ubuntu:ubuntu %(root)s" % env)
  tmp_folder = env.tmp_dir
  run("mkdir -p %(tmp_folder)s" % locals())
  print green("Downloading the build %(bin)s..." % locals())
  run("s3cmd get --force %(bin)s %(tmp_folder)s/%(cassandra_local_tar)s" % locals(), quiet=True)
  run("tar xvzf %(tmp_folder)s/%(cassandra_local_tar)s -C %(tmp_folder)s; rm %(tmp_folder)s/%(cassandra_local_tar)s" % locals(), quiet=True)
  deployments._rsync("conf/cassandra-env.sh", "%(tmp_folder)s/%(cassandra_version)s/conf/cassandra-env.sh" % locals())
  # if the client does not specify the seeds, it will try to figure it out from datacenter and realm
  if not seeds:
    seeds = ','.join(deployments._get_relevant_hosts(datacenter=datacenter, realm=realm, region=region, private_ip=True))
  print green("Seeds: " + seeds)
  installed_dir = "%(tmp_folder)s/%(cassandra_version)s" % locals()
  _setup_cassandra(datacenter, seeds, project, roleval, installed_dir)
  return installed_dir
Esempio n. 2
0
def print_hosts(datacenter, realm='*', region="us-east-1", instance_type='*', private_ip=False, verbose=False):
  """ print all ips given realm and datacenter. """
  hosts = deployments._get_relevant_hosts(datacenter, realm, region, instance_type, private_ip, verbose)
  print green(",".join(hosts))
  env.hosts = hosts