MCPcopy Create free account
hub / github.com/apache/mesos / initialize

Method initialize

src/master/master.cpp:448–1146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

446
447
448void Master::initialize()
449{
450 LOG(INFO) << "Master " << info_.id() << " (" << info_.hostname() << ")"
451 << " started on " << string(self()).substr(7);
452
453 LOG(INFO) << "Flags at startup: " << flags;
454
455 if (process::address().ip.isLoopback()) {
456 LOG(WARNING) << "\n**************************************************\n"
457 << "Master bound to loopback interface!"
458 << " Cannot communicate with remote schedulers or agents."
459 << " You might want to set '--ip' flag to a routable"
460 << " IP address.\n"
461 << "**************************************************";
462 }
463
464 // NOTE: We enforce a minimum slave reregister timeout because the
465 // slave bounds its (re-)registration retries based on the minimum.
466 if (flags.agent_reregister_timeout < MIN_AGENT_REREGISTER_TIMEOUT) {
467 EXIT(EXIT_FAILURE)
468 << "Invalid value '" << flags.agent_reregister_timeout << "'"
469 << " for --agent_reregister_timeout:"
470 << " Must be at least " << MIN_AGENT_REREGISTER_TIMEOUT;
471 }
472
473 // Parse the percentage for the slave removal limit.
474 // TODO(bmahler): Add a 'Percentage' abstraction.
475 if (!strings::endsWith(flags.recovery_agent_removal_limit, "%")) {
476 EXIT(EXIT_FAILURE)
477 << "Invalid value '" << flags.recovery_agent_removal_limit << "'"
478 << " for --recovery_agent_removal_percent_limit: " << "missing '%'";
479 }
480
481 Try<double> limit = numify<double>(
482 strings::remove(
483 flags.recovery_agent_removal_limit,
484 "%",
485 strings::SUFFIX));
486
487 if (limit.isError()) {
488 EXIT(EXIT_FAILURE)
489 << "Invalid value '" << flags.recovery_agent_removal_limit << "'"
490 << " for --recovery_agent_removal_percent_limit: " << limit.error();
491 }
492
493 if (limit.get() < 0.0 || limit.get() > 100.0) {
494 EXIT(EXIT_FAILURE)
495 << "Invalid value '" << flags.recovery_agent_removal_limit << "'"
496 << " for --recovery_agent_removal_percent_limit:"
497 << " Must be within [0%-100%]";
498 }
499
500 // Log authentication state.
501 if (flags.authenticate_frameworks) {
502 LOG(INFO) << "Master only allowing authenticated frameworks to register";
503 } else {
504 LOG(INFO) << "Master allowing unauthenticated frameworks to register";
505 }

Callers

nothing calls this directly

Calls 15

endsWithFunction · 0.85
splitFunction · 0.85
NoneClass · 0.85
tokenizeFunction · 0.85
deferFunction · 0.85
logRequestFunction · 0.85
logResponseFunction · 0.85
authorizeLogAccessFunction · 0.85
getLogFileFunction · 0.85
getLogSeverityFunction · 0.85
isLoopbackMethod · 0.80

Tested by

no test coverage detected