Ejemplo n.º 1
0
    def setUp(self):
        super(TestUtils, self).setUp()
        self.plugin = p.VanillaProvider()

        self.ng_manager = tu.make_ng_dict(
            'mng', 'f1', ['manager'], 1,
            [tu.make_inst_dict('mng1', 'manager')])
        self.ng_namenode = tu.make_ng_dict(
            'nn', 'f1', ['namenode'], 1,
            [tu.make_inst_dict('nn1', 'namenode')])
        self.ng_resourcemanager = tu.make_ng_dict(
            'jt', 'f1', ['resourcemanager'], 1,
            [tu.make_inst_dict('jt1', 'resourcemanager')])
        self.ng_datanode = tu.make_ng_dict('dn', 'f1', ['datanode'], 2, [
            tu.make_inst_dict('dn1', 'datanode-1'),
            tu.make_inst_dict('dn2', 'datanode-2')
        ])
        self.ng_nodemanager = tu.make_ng_dict('tt', 'f1', ['nodemanager'], 2, [
            tu.make_inst_dict('tt1', 'nodemanager-1'),
            tu.make_inst_dict('tt2', 'nodemanager-2')
        ])
        self.ng_oozie = tu.make_ng_dict('ooz1', 'f1', ['oozie'], 1,
                                        [tu.make_inst_dict('ooz1', 'oozie')])
        self.ng_hiveserver = tu.make_ng_dict(
            'hs', 'f1', ['hiveserver'], 1,
            [tu.make_inst_dict('hs1', 'hiveserver')])
        self.ng_secondarynamenode = tu.make_ng_dict(
            'snn', 'f1', ['secondarynamenode'], 1,
            [tu.make_inst_dict('snn1', 'secondarynamenode')])
Ejemplo n.º 2
0
    def _get_cluster(self):
        i1 = tu.make_inst_dict('id_1', 'instance_1', '1.1.1.1')
        master_proc = [
            yarn.RESOURCE_MANAGER.ui_name,
            yarn.NODE_MANAGER.ui_name,
            yarn.HISTORY_SERVER.ui_name,
            maprfs.CLDB.ui_name,
            maprfs.FILE_SERVER.ui_name,
            oozie.OOZIE.ui_name,
            management.ZOOKEEPER.ui_name,
        ]

        master_ng = tu.make_ng_dict('master', 'large', master_proc, 1, [i1])
        cluster_configs = {
            'Service': {
                'key': 'value',
                'Service Version': '1.1',
            },
        }

        cluster = tu.create_cluster(
            name='test_cluster',
            project='large',
            plugin='mapr',
            version='5.2.0.mrv2',
            node_groups=[master_ng],
            cluster_configs=cluster_configs,
        )
        self.ng = cluster.node_groups[0]
        self.instance = self.ng.instances[0]
        return cluster
Ejemplo n.º 3
0
 def _get_context(self):
     i1 = tu.make_inst_dict('id_1', 'instance_1', MANAGEMENT_IP)
     i1['internal_ip'] = INTERNAL_IP
     master_proc = [
         yarn.RESOURCE_MANAGER.ui_name,
         yarn.NODE_MANAGER.ui_name,
         yarn.HISTORY_SERVER.ui_name,
         maprfs.CLDB.ui_name,
         maprfs.FILE_SERVER.ui_name,
         oozie.OOZIE.ui_name,
         management.ZOOKEEPER.ui_name,
     ]
     master_ng = tu.make_ng_dict('master', 'large', master_proc, 1, [i1])
     cluster_configs = {
         'Service': {
             'key': 'value',
             'Service Version': '1.1',
         },
         'Oozie': {
             'Oozie Version': '4.2.0',
         }
     }
     cluster = tu.create_cluster(
         name='test_cluster',
         project='large',
         plugin='mapr',
         version='5.2.0.mrv2',
         node_groups=[master_ng],
         cluster_configs=cluster_configs,
     )
     self.ng = cluster.node_groups[0]
     self.instance = self.ng.instances[0]
     return cc.Context(cluster, version_handler.VersionHandler())
Ejemplo n.º 4
0
def _get_workers():
    workers = []
    for i in range(3):
        w = tu.make_inst_dict('id0%d' % i, 'worker-0%d' % i,
                              management_ip='1.2.3.1%d' % i)
        workers.append(w)

    return workers
Ejemplo n.º 5
0
def get_fake_cluster(**kwargs):
    mng = tu.make_inst_dict('id1', 'manager_inst', management_ip='1.2.3.4')
    mng_ng = tu.make_ng_dict('manager_ng', 1, ['CLOUDERA_MANAGER'], 1, [mng])

    mst = tu.make_inst_dict('id2', 'master_inst', management_ip='1.2.3.5')
    mst_ng = tu.make_ng_dict('master_ng', 1, ['HDFS_NAMENODE',
                                              'HDFS_SECONDARYNAMENODE',
                                              'YARN_RESOURCEMANAGER',
                                              'YARN_JOBHISTORY',
                                              'HIVE_SERVER2',
                                              'HIVE_METASTORE',
                                              'OOZIE_SERVER'], 1, [mst])

    wkrs = _get_workers()
    wkrs_ng = tu.make_ng_dict('worker_ng', 1, ['HDFS_DATANODE',
                                               'YARN_NODEMANAGER'],
                              len(wkrs), wkrs)
    return tu.create_cluster('test_cluster', 1, 'cdh', '5',
                             [mng_ng, mst_ng, wkrs_ng],
                             **kwargs)
def make_ng_dict_with_inst(counter,
                           name,
                           flavor,
                           processes,
                           count,
                           instances=None,
                           volumes_size=None,
                           node_configs=None,
                           **kwargs):
    if not instances:
        instances = []
        for i in range(count):
            n = six.next(counter)
            instance = tu.make_inst_dict("id{0}".format(n),
                                         "fake_inst{0}".format(n),
                                         management_ip='1.2.3.{0}'.format(n))
            instances.append(instance)
    return tu.make_ng_dict(name, flavor, processes, count, instances,
                           volumes_size, node_configs, **kwargs)