Example #1
0
 def test_get_ng_params_default(self):
     ng_configs = configs.get_ng_params(self.ng)
     expected = [
         {
             "hdfs-site": {
                 "dfs.datanode.data.dir":
                 "/data1/hdfs/data,/data2/hdfs/data",
                 "dfs.journalnode.edits.dir":
                 "/data1/hdfs/journalnode,/data2/hdfs/journalnode",
                 "dfs.namenode.checkpoint.dir":
                 "/data1/hdfs/namesecondary,/data2/hdfs/namesecondary",
                 "dfs.namenode.name.dir":
                 "/data1/hdfs/namenode,/data2/hdfs/namenode"
             }
         },
         {
             "yarn-site": {
                 "yarn.nodemanager.local-dirs":
                 "/data1/yarn/local,/data2/yarn/local",
                 "yarn.nodemanager.log-dirs":
                 "/data1/yarn/log,/data2/yarn/log",
                 "yarn.timeline-service.leveldb-timeline-store.path":
                 "/data1/yarn/timeline,/data2/yarn/timeline"
             }
         }
     ]
     self.assertConfigEqual(expected, ng_configs)
Example #2
0
def create_blueprint(cluster):
    _prepare_ranger(cluster)
    cluster = conductor.cluster_get(context.ctx(), cluster.id)
    host_groups = []
    for ng in cluster.node_groups:
        hg = {
            "name": ng.name,
            "configurations": configs.get_ng_params(ng),
            "components": []
        }
        procs = p_common.get_ambari_proc_list(ng)
        procs.extend(p_common.get_clients(cluster))
        for proc in procs:
            hg["components"].append({"name": proc})
        host_groups.append(hg)
    bp = {
        "Blueprints": {
            "stack_name": "HDP",
            "stack_version": cluster.hadoop_version
        },
        "host_groups": host_groups,
        "configurations": configs.get_cluster_params(cluster)
    }
    ambari = plugin_utils.get_instance(cluster, p_common.AMBARI_SERVER)
    password = cluster.extra["ambari_password"]
    with ambari_client.AmbariClient(ambari, password=password) as client:
        client.create_blueprint(cluster.name, bp)
Example #3
0
 def test_get_ng_params(self):
     self.ng.node_configs = {
         "YARN": {
             "mapreduce.map.java.opts": "-Dk=v",
             "yarn.scheduler.minimum-allocation-mb": "256"
         }
     }
     ng_configs = configs.get_ng_params(self.ng)
     expected = [
         {
             "hdfs-site": {
                 "dfs.datanode.data.dir":
                 "/data1/hdfs/data,/data2/hdfs/data",
                 "dfs.journalnode.edits.dir":
                 "/data1/hdfs/journalnode,/data2/hdfs/journalnode",
                 "dfs.namenode.checkpoint.dir":
                 "/data1/hdfs/namesecondary,/data2/hdfs/namesecondary",
                 "dfs.namenode.name.dir":
                 "/data1/hdfs/namenode,/data2/hdfs/namenode"
             }
         },
         {
             "mapred-site": {
                 "mapreduce.map.java.opts": "-Dk=v"
             }
         },
         {
             "yarn-site": {
                 "yarn.nodemanager.local-dirs":
                 "/data1/yarn/local,/data2/yarn/local",
                 "yarn.nodemanager.log-dirs":
                 "/data1/yarn/log,/data2/yarn/log",
                 "yarn.scheduler.minimum-allocation-mb": "256",
                 "yarn.timeline-service.leveldb-timeline-store.path":
                 "/data1/yarn/timeline,/data2/yarn/timeline"
             }
         }
     ]
     self.assertConfigEqual(expected, ng_configs)