"""Create Yarn cluster""" try: current_task.update_state(state="Started") self.HOSTNAME_MASTER_IP, self.server_dict = self.create_bare_cluster( ) except Exception, e: logging.error(str(e.args[0])) raise # Update cluster info with the master VM root password. set_cluster_state(self.opts['token'], self.cluster_id, 'Configuring YARN cluster node communication (2/3)', password=self.master_root_pass) try: list_of_hosts = reroute_ssh_prep(self.server_dict, self.HOSTNAME_MASTER_IP) set_cluster_state(self.opts['token'], self.cluster_id, 'Installing and configuring YARN (3/3)') install_yarn(self.opts['token'], list_of_hosts, self.HOSTNAME_MASTER_IP, self.cluster_name_postfix_id, self.orka_image_uuid, self.ssh_file, self.opts['replication_factor'], self.opts['dfs_blocksize']) except Exception, e: logging.error(str(e.args[0])) logging.error('Created cluster and resources will be deleted') # If error in Yarn cluster, update cluster status as destroyed set_cluster_state(self.opts['token'], self.cluster_id,
def create_yarn_cluster(self): """Create Yarn cluster""" try: current_task.update_state(state="Started") self.HOSTNAME_MASTER_IP, self.server_dict = self.create_bare_cluster() except Exception, e: logging.error(str(e.args[0])) raise # Update cluster info with the master VM root password. set_cluster_state(self.opts['token'], self.cluster_id, 'Configuring YARN cluster node communication (2/3)', password=self.master_root_pass) try: list_of_hosts = reroute_ssh_prep(self.server_dict, self.HOSTNAME_MASTER_IP) set_cluster_state(self.opts['token'], self.cluster_id, 'Installing and configuring YARN (3/3)') install_yarn(self.opts['token'], list_of_hosts, self.HOSTNAME_MASTER_IP, self.cluster_name_postfix_id, self.orka_image_uuid, self.ssh_file, self.opts['replication_factor'], self.opts['dfs_blocksize']) except Exception, e: logging.error(str(e.args[0])) logging.error('Created cluster and resources will be deleted') # If error in Yarn cluster, update cluster status as destroyed set_cluster_state(self.opts['token'], self.cluster_id, 'Error', status='Failed', error=str(e.args[0])) self.destroy('Failed') raise finally:
def create_yarn_cluster(self): self.HOSTNAME_MASTER_IP, self.server_dict = self.c_hadoop_cluster.create_bare_cluster() list_of_hosts = reroute_ssh_prep(self.server_dict, self.HOSTNAME_MASTER_IP) install_yarn(list_of_hosts, self.HOSTNAME_MASTER_IP, self.opts['name']) logging.log(REPORT, ' Bare cluster has been created.') return self.HOSTNAME_MASTER_IP, self.server_dict
def create_yarn_cluster(self): """Create YARN cluster on a bare ~okeanos cluster """ try: current_task.update_state(state="Started") self.HOSTNAME_MASTER_IP, self.server_dict = self.create_bare_cluster() except Exception, e: logging.error(str(e.args[0])) raise # Update cluster info with the master VM root password. set_cluster_state(self.opts['token'], self.cluster_id, 'Configuring YARN cluster node communication (2/3)', password=self.master_root_pass) try: # Configuring YARN cluster node communication list_of_hosts = reroute_ssh_prep(self.server_dict,self.HOSTNAME_MASTER_IP, linux_dist=get_system_dist(self.opts['os_choice'])) set_cluster_state(self.opts['token'], self.cluster_id, 'Installing and configuring YARN (3/3)') # Installing and configuring YARN install_yarn(self.opts['token'], list_of_hosts, self.HOSTNAME_MASTER_IP, self.cluster_name_postfix_id, self.orka_image_uuid, self.ssh_file, self.opts['replication_factor'], self.opts['dfs_blocksize'], self.opts['admin_password']) except Exception, e: logging.error(str(e.args[0])) logging.error('Created cluster and resources will be deleted') # If error in Yarn cluster, update cluster status as destroyed set_cluster_state(self.opts['token'], self.cluster_id, 'Error', status='Failed', error=str(e.args[0])) self.destroy('Failed') raise finally: