def bootstrap(args): get_hdfs_service_config(args) cleanup_token = deploy_utils.confirm_bootstrap("hdfs", args.hdfs_config) for job_name in args.job or ALL_JOBS: hosts = args.hdfs_config.jobs[job_name].hosts first = True if job_name == "namenode": while not check_journalnode_all_started(args): Log.print_warning("Wait for journalnode starting") time.sleep(2) for id in args.task or hosts.iterkeys(): if job_name == "namenode" and not first: while not deploy_utils.check_service(hosts[0], args.hdfs_config.jobs["namenode"].base_port): Log.print_warning("Wait for active namenode starting") time.sleep(2) bootstrap_job(args, hosts[id], job_name, first, cleanup_token) first = False