def start_cluster(cluster): if pu.get_oozie(cluster): _install_extjs(cluster) if pu.get_hive_metastore(cluster): _configure_hive(cluster) if pu.get_sentry(cluster): _configure_sentry(cluster) cu.first_run(cluster) if c_helper.is_swift_enabled(cluster): instances = gu.get_instances(cluster) _configure_swift(instances) if pu.get_hive_metastore(cluster): _put_hive_hdfs_xml(cluster) if pu.get_flumes(cluster): cm_cluster = cu.get_cloudera_cluster(cluster) flume = cm_cluster.get_service(cu.FLUME_SERVICE_NAME) cu.start_service(flume) cu.restart_mgmt_service(cluster)
def start_cluster(cluster): cm_cluster = cu.get_cloudera_cluster(cluster) hdfs = cm_cluster.get_service(cu.HDFS_SERVICE_NAME) cu.format_namenode(hdfs) cu.start_service(hdfs) yarn = cm_cluster.get_service(cu.YARN_SERVICE_NAME) cu.create_yarn_job_history_dir(yarn) cu.start_service(yarn) oozie_inst = pu.get_oozie(cluster) if oozie_inst: _install_extjs(cluster) oozie = cm_cluster.get_service(cu.OOZIE_SERVICE_NAME) cu.create_oozie_db(oozie) cu.install_oozie_sharelib(oozie) cu.start_service(oozie) if pu.get_hive_metastore(cluster): hive = cm_cluster.get_service(cu.HIVE_SERVICE_NAME) _configure_hive(cluster) cu.create_hive_metastore_db(hive) cu.create_hive_dirs(hive) cu.start_service(hive) if pu.get_hue(cluster): hue = cm_cluster.get_service(cu.HUE_SERVICE_NAME) cu.start_service(hue) if pu.get_spark_historyserver(cluster): _configure_spark(cluster) spark = cm_cluster.get_service(cu.SPARK_SERVICE_NAME) cu.start_service(spark)
def _install_extjs(cluster): extjs_remote_location = c_helper.get_extjs_lib_url(cluster) extjs_vm_location_dir = '/var/lib/oozie' extjs_vm_location_path = extjs_vm_location_dir + '/extjs.zip' with pu.get_oozie(cluster).remote() as r: if r.execute_command('ls %s/ext-2.2' % extjs_vm_location_dir, raise_when_error=False)[0] != 0: r.execute_command('curl -L -o \'%s\' %s' % (extjs_vm_location_path, extjs_remote_location), run_as_root=True) r.execute_command('unzip %s -d %s' % (extjs_vm_location_path, extjs_vm_location_dir), run_as_root=True)
def _install_extjs(cluster): extjs_remote_location = c_helper.get_extjs_lib_url(cluster) extjs_vm_location_dir = '/var/lib/oozie' extjs_vm_location_path = extjs_vm_location_dir + '/extjs.zip' with pu.get_oozie(cluster).remote() as r: if r.execute_command('ls %s/ext-2.2' % extjs_vm_location_dir, raise_when_error=False)[0] != 0: r.execute_command('curl -L -o \'%s\' %s' % ( extjs_vm_location_path, extjs_remote_location), run_as_root=True) r.execute_command('unzip %s -d %s' % ( extjs_vm_location_path, extjs_vm_location_dir), run_as_root=True)
def start_cluster(cluster): _clean_deploy_cc(cluster) if pu.get_oozie(cluster): _install_extjs(cluster) if pu.get_hive_metastore(cluster): _configure_hive(cluster) cu.first_run(cluster) if pu.get_hive_metastore(cluster): _put_hive_hdfs_xml(cluster) _restore_deploy_cc(cluster)
def test_get_oozie(self): cluster = tu.get_fake_cluster() inst = u.get_oozie(cluster) self.assertEqual('id2', inst.instance_id)
def get_oozie_server_uri(self, cluster): oozie_ip = cu.get_oozie(cluster).management_ip return 'http://%s:11000/oozie' % oozie_ip
def get_oozie_server(self, cluster): return cu.get_oozie(cluster)