Hey Viktor,

I'm not clear what you mean by "re-install the same framework" - do you
mean, just restarting the binary?
If so, as Vinod pointed out, you should re-register with a SUBSCRIBE
message and obtain a new FrameworkId in the response.

And, yes, the name can stay perfectly the same (in fact, you can have
several frameworks with the same name - but different IDs - connect to the
same Master).

Are you using the C++ API or the new HTTP API?

If the latter, please have a look at the example here[0] for how to
"terminate" a framework and then reconnect it.
(in particular, see the sections "Registering a Framework" and "Terminating
a Framework").

If the former, see [1] where I set the `name` in the `FrameworkInfo` (and
that one stays the same across runs) but not the ID (that one gets returned
in the `registered()`[2] method and can be used, if necessary elsewhere in
the code; for example, when accepting offers; but should otherwise stay
unique to the FW).

There are many (better!) examples around of frameworks also in the
"Examples" folder in the Mesos source code[3]; you may want to take a look
there too.


[0]
https://github.com/massenz/zk-mesos/blob/develop/notebooks/Demo-API.ipynb
[1]
https://github.com/massenz/mongo_fw/blob/develop/src/mongo_scheduler.cpp#L194
[2]
https://github.com/massenz/mongo_fw/blob/develop/src/mongo_scheduler.cpp#L70
[3]
https://git-wip-us.apache.org/repos/asf?p=mesos.git;a=tree;f=src/examples

-- 
*Marco Massenzio*
http://codetrips.com

On Sat, Jan 16, 2016 at 12:52 AM, Viktor Sadovnikov <[email protected]>
wrote:

> Yes, I need to re-install the same framework. It can get another ID, but
> its name should remain the same.
> I though the framework ID dynamically assigned by the Master upon the
> connection and did not expect the Master to provide the same ID
>
> On Fri, Jan 15, 2016 at 10:15 PM, Vinod Kone <[email protected]> wrote:
>
>> What do you mean by gracefully recover? If you mean the ability to
>> reconnect, you need to change the framework id in the FrameworkInfo when
>> registering with the master.
>>
>> As a hack, you could restart the master, so that it forgets that it
>> removed the framework with id XXXX and hence allows it to re-register with
>> the old id.
>>
>> On Fri, Jan 15, 2016 at 5:37 AM, Viktor Sadovnikov <[email protected]>
>> wrote:
>>
>>> Hello,
>>>
>>> I have removed a framework from Mesos Cluster by curl -X POST -d
>>> 'frameworkId=XXXXXXXX-b036-4cb7-af53-4c837dc9521d-0002' 
>>> http://${MASTER_IP}:5050/master/teardown";.
>>> This successfully removed all the framework tasks and scheduler.
>>>
>>> However now Mesos Cluster rejects my attempts to re-install the
>>> framework. Is there a way to gracefully recover from this situation?
>>>
>>> I0115 12:54:57.916470 28856 sched.cpp:1024] Got error 'Framework has
>>> been removed'
>>> I0115 12:54:57.916509 28856 sched.cpp:1805] Asked to abort the driver
>>> I0115 12:54:57.916824 28856 sched.cpp:1070] Aborting framework
>>> '8ca5c18f-b036-4cb7-af53-4c837dc9521d-0001'
>>>
>>> With regards,
>>> Viktor
>>>
>>
>>
>

Reply via email to