The maintenance endpoints do not reject any "machine_ids".  They only
reject ones that are formatted wrong or are missing fields.

On Wed, Aug 31, 2016 at 8:44 AM, Olivier Sallou <[email protected]>
wrote:

>
>
> ----- Mail original -----
> > De: "Joseph Wu" <[email protected]>
> > À: "dev" <[email protected]>
> > Envoyé: Mercredi 31 Août 2016 17:16:57
> > Objet: Re: Maintenance API question
> >
> > Most likely, the hostname and IP you've put into the "machine_Ids"
> > does not *exactly
> > match* the hostname and IP the agent is identifying itself as.
>
> in this case master should reject the request according to the
> documentation. Here it is accepted (200 OK in response and appears in
> maintenance/schedule  and maintenance/status
>
>   If in
> > doubt, you can check the master's /slaves endpoint.  Or, you can manually
> > set the hostname and IP when starting the agent.
>
>
> I took information for the master UI and it is the same.
>
> Maybe the issue is the fact I am on a single machine, so hostname and ip
> are the same for master and slave....
>
> >
> > On Wed, Aug 31, 2016 at 3:16 AM, Olivier Sallou <[email protected]
> >
> > wrote:
> >
> > > Hi,
> > > I am trying to use the /maintenance API for mesos slave
> maintenance/drain.
> > >
> > > I follow doc at http://mesos.apache.org/documentation/latest/
> maintenance/
> > >
> > > I use mesos 1.0.1 on a single machine (for dev).
> > >
> > > When scheduling a node using
> > >
> > >
> > >
> > > {
> > > "windows" : [
> > > {
> > > "machine_ids" : [
> > > { "hostname" : "tifenn.irisa.fr", "ip" : "127.0.0.1" }
> > > ],
> > > "unavailability" : {
> > > "start" : { "nanoseconds" : 1472637340000000000 },
> > > "duration" : { "nanoseconds" : 3600000000000 }
> > > }
> > > }
> > > ]
> > > }
> > >
> > >
> > >
> > >
> > > The start date is set in the recent past (setting to future did not
> > > change).
> > >
> > >
> > > I see in /maintenance/status
> > >
> > > {"draining_machines":[{"id":{"hostname":"tifenn.irisa.fr","
> > > ip":"127.0.0.1"}}]}
> > >
> > > However, the offers I receive do not contain the unavailibility
> parameter.
> > > I do not know if it is expected, but start/duration do not appear in
> > > maintenance/status result.
> > > I see in master logs: HTTP POST for /master/maintenance/schedule from
> > > 127.0.0.1:34858 with User-Agent='curl/7.43.0'
> > >
> > >
> > > I tried anyway to switch the node to maintenance (/maintenance/down)
> but I
> > > continue to receive offers for this slave. In status, I see my slave in
> > > machines_down:
> > >
> > > {"down_machines":[{"hostname":"tifenn.irisa.fr","ip":"127.0.0.1"}]}
> > >
> > > I can see on master logs:
> > >
> > >
> > >
> > > I0831 12:12:37.568898 6428 http.cpp:381] HTTP POST for
> > > /master/machine/down from 127.0.0.1:34970 with
> User-Agent='curl/7.43.0'
> > >
> > > ....
> > >
> > > Sending 1 offers to framework a559cd9e-3e58-4377-9e1a-
> c8f3d28d2318-0000
> > > (Go-Docker Mesos) at scheduler-41e42d1f-b8f8-473a-
> > > [email protected]:43060
> > >
> > >
> > >
> > >
> > > Should something be set to enable maintenance in mesos ?
> > >
> > >
> > >
> > >
> > > Thanks
> > >
> > >
> > >
> > >
> > > Olivier
> > >
> >
>

Reply via email to