Ejemplo n.º 1
0
def generate_metrics_config(args, host, job_name, instance_id=-1):
    job = args.hbase_config.jobs[job_name]

    supervisor_client = deploy_utils.get_supervisor_client(
        host,
        "hbase",
        args.hbase_config.cluster.name,
        job_name,
        instance_id=instance_id)

    ganglia_switch = "# "
    if args.hbase_config.cluster.ganglia_address:
        ganglia_switch = ""
    config_dict = {
        "job_name": job_name,
        "period": 10,
        "data_dir": supervisor_client.get_log_dir(),
        "ganglia_address": args.hbase_config.cluster.ganglia_address,
        "ganglia_switch": ganglia_switch,
    }

    local_path = "%s/hadoop-metrics.properties.tmpl" % deploy_utils.get_template_dir(
    )
    template = deploy_utils.Template(open(local_path, "r").read())
    return template.substitute(config_dict)
Ejemplo n.º 2
0
def generate_zookeeper_config(args):
  config_dict = args.zookeeper_config.configuration.generated_files["zookeeper.cfg"]
  local_path = "%s/zookeeper.cfg.tmpl" % deploy_utils.get_template_dir()
  template = deploy_utils.Template(open(local_path, "r").read())
  return template.substitute(config_dict)