Search code examples
mesosmarathon

How to launch a framework via Mesos REST API


Everyone:

I'm wondering how to launch a framework (e.g. a docker app) via Mesos' REST API? I just checked all the HTTP endpoints. But I don't see anything helpful.

The reason for this question is that, I've tried Marathon, which just need a Mesos master's address, and we can launch a framework over Mesos via Marathon's REST API.
I think Marathon takes advantages over Mesos's API. But I don't want to involve Marathon. I want to launch a framework directly via Mesos REST API. Could someone please help? What's the best approach?

Thanks


Solution

  • Like Tobi say, you can use Mesos Scheduler API to communicate with Mesos master wihtout Marathon.

    You just need write a Mesos scheduler, Mesos have default docker excutor.

    For your own framework, you need to Send a SUBSCRIBE json to Mesos Master to register. then, you would receive offer EVENT. user offer id, you send ACCEPT msg, you would lanch your application.

    reference:

    Mesos Scheduler API

    Mesos github example

    Rendler example