Exemplo n.º 1
0
func main() {
	runtime.GOMAXPROCS(1)
	log.SetLevel(log.DebugLevel)

	if logFile != "" {
		fo, logErr := os.Create(logFile)
		if logErr != nil {
			panic(logErr)
		}
		log.SetOutput(fo)
	}

	if frameNameRegex.FindString(frameworkName) != frameworkName {
		log.Fatal("Error, framework name not valid")
	}

	sched := scheduler.NewSchedulerCore(
		schedulerHostname,
		frameworkName,
		frameworkRole,
		[]string{zookeeperAddr},
		schedulerIPAddr,
		user,
		nodeCpus,
		nodeMem,
		nodeDisk,
		authProvider,
		mesosAuthPrincipal,
		mesosAuthSecretFile,
		useReservations)
	sched.Run(mesosMaster)
}
Exemplo n.º 2
0
func main() {
	log.SetLevel(log.DebugLevel)

	if logFile != "" {
		fo, logErr := os.Create(logFile)
		if logErr != nil {
			panic(logErr)
		}
		log.SetOutput(fo)
	}

	if frameNameRegex.FindString(frameworkName) != frameworkName {
		log.Fatal("Error, framework name not valid")
	}
	// When starting scheduler from Marathon, PORT0-N env vars will be set
	rexPortStr := os.Getenv("PORT1")

	// If PORT1 isn't set, fallback to a hardcoded one for now
	// TODO: Sargun fix me
	if rexPortStr == "" {
		rexPortStr = "9090"
	}

	rexPort, portErr := strconv.Atoi(rexPortStr)
	if portErr != nil {
		log.Fatal(portErr)
	}

	sched := scheduler.NewSchedulerCore(
		schedulerHostname,
		frameworkName,
		frameworkRole,
		[]string{zookeeperAddr},
		schedulerIPAddr,
		user,
		rexPort,
		authProvider,
		mesosAuthPrincipal,
		mesosAuthSecretFile)
	sched.Run(mesosMaster)
}