You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ambari.apache.org by Greg Hill <gr...@RACKSPACE.COM> on 2014/07/18 23:13:43 UTC

stopping host components via API

This used to be accomplished by doing a PUT with this message to the host resource:

{"RequestInfo": {"context" :"Stop All Components"}, "Body": {"HostRoles": {"state": "INSTALLED"}}}

But that doesn't appear to work any more.  It worked a few weeks ago.  Is there somewhere where changes like this are being documented?

Greg

Re: stopping host components via API

Posted by Greg Hill <gr...@RACKSPACE.COM>.
I opened https://issues.apache.org/jira/browse/AMBARI-6556

I'll look into adjusting the code to use the alternative approach.

Greg

From: Srimanth Gunturi <sr...@hortonworks.com>>
Reply-To: "user@ambari.apache.org<ma...@ambari.apache.org>" <us...@ambari.apache.org>>
Date: Tuesday, July 22, 2014 4:40 PM
To: "user@ambari.apache.org<ma...@ambari.apache.org>" <us...@ambari.apache.org>>
Subject: Re: stopping host components via API

Hi Greg,
I would recommend putting the host in maintenance mode as shown in my API call (PUT http://c6401:8080/api/v1/clusters/c1/hosts).

Also, can you please open a JIRA about this problem with your current API usage?
Regards,
Srimanth



On Tue, Jul 22, 2014 at 5:16 AM, Greg Hill <gr...@rackspace.com>> wrote:
Sure.  It's possible I'm doing something wrong.

Setting maintenance mode:

PUT /clusters/testcluster/hosts/c6401.ambari.apache.org/host_components?fields=HostRoles/state<http://c6401.ambari.apache.org/host_components?fields=HostRoles/state>
       {
            "RequestInfo": {
                "context" :"Start Maintanence Mode",
            },
            "Body": {
                "HostRoles": {"maintenance_state": "ON"},
            },
        }

Stopping all components:

PUT /clusters/testcluster/hosts/c6401.ambari.apache.org/host_components?fields=HostRoles/state<http://c6401.ambari.apache.org/host_components?fields=HostRoles/state>
       {
            "RequestInfo": {
                "context" :"Stop All Components",
            },
            "Body": {
                "HostRoles": {"state": "INSTALLED"},
            },
        }

From: Srimanth Gunturi <sr...@hortonworks.com>>
Reply-To: "user@ambari.apache.org<ma...@ambari.apache.org>" <us...@ambari.apache.org>>
Date: Monday, July 21, 2014 3:03 PM
To: "user@ambari.apache.org<ma...@ambari.apache.org>" <us...@ambari.apache.org>>
Subject: Re: stopping host components via API

Hi Greg,
Was wondering which version of Ambari you were using?

When maintenance mode is enabled on service, bulk host operations are ignored.
When maintenance mode is enabled on hosts, service level operations are ignored on host.
So was wondering if you enabled maintenance mode in one level, and performed operations on another?

I tried the following on trunk, and it stopped all host-components in maintenance mode.
=========
PUT http://c6401:8080/api/v1/clusters/c1/hosts
{
  "RequestInfo": {
    "context": "Turn On Maintenance Mode for host",
    "query": "Hosts/host_name.in<http://host_name.in>(c6401.ambari.apache.org<http://c6401.ambari.apache.org>)"
  },
  "Body": {
    "Hosts": {
      "maintenance_state": "ON"
    }
  }
}
=========
PUT http://c6401:8080/api/v1/clusters/c1/hosts/c6401.ambari.apache.org/host_components?
{
  "RequestInfo": {
    "context": "Stop All Host Components",
    "operation_level": {
      "level": "HOST",
      "cluster_name": "c1",
      "host_names": "c6401.ambari.apache.org<http://c6401.ambari.apache.org>"
    },
    "query": "HostRoles/component_name.in<http://component_name.in>(APP_TIMELINE_SERVER,DATANODE,HISTORYSERVER,NAMENODE,NODEMANAGER,RESOURCEMANAGER,SECONDARY_NAMENODE,ZOOKEEPER_SERVER)"
  },
  "Body": {
    "HostRoles": {
      "state": "INSTALLED"
    }
  }
}
=========

Maybe listing the API calls you make might help.
Regards,
Srimanth




On Mon, Jul 21, 2014 at 10:54 AM, Greg Hill <gr...@rackspace.com>> wrote:
Anyone know if this is intentional or not?  It seems to ignore setting the
HostRole/state if the host_component is in maintenance mode.  I was able
to work around it by immediately setting maintenance mode after changing
the state. But that leads to a race condition as to whether nagios notices
the downed services before maintenance mode kicks in.

IMO, it shouldn't behave this way.  There's no safe way to stop services
as it is right now.  It should let you stop them during maintenance, as
that's really the primary reason you'd want to set maintenance.

Should I just open a bug?

Greg

On 7/21/14 8:02 AM, "Greg Hill" <gr...@RACKSPACE.COM>> wrote:

>I did some debugging and it turns out that the problem is that I set
>maintenance mode prior to stopping the components.  Unfortunately, this
>makes it so nagios starts alerting me.  My script is attempting to remove
>a slave node from a cluster by doing the following:
>
>1. Set maintenance mode on all host_components.
>2. Stop all host_components.
>3. Remove all host_components.
>4. Remove host from cluster.
>
>This was what I had worked out to be the proper procedure a few weeks
>back.  Am I doing something wrong or did I discover a bug?
>
>Greg
>
>
>On 7/18/14 7:15 PM, "Yusaku Sako" <yu...@hortonworks.com>> wrote:
>
>>Greg,
>>
>>That should not be broken.
>>What is the exact call you are trying to make (can you post the
>>equivalent curl call)?
>>
>>Yusaku
>>
>>On Fri, Jul 18, 2014 at 2:13 PM, Greg Hill <gr...@rackspace.com>>
>>wrote:
>>> This used to be accomplished by doing a PUT with this message to the
>>>host
>>> resource:
>>>
>>> {"RequestInfo": {"context" :"Stop All Components"}, "Body":
>>>{"HostRoles":
>>> {"state": "INSTALLED"}}}
>>>
>>> But that doesn't appear to work any more.  It worked a few weeks ago.
>>>Is
>>> there somewhere where changes like this are being documented?
>>>
>>> Greg
>>
>>--
>>CONFIDENTIALITY NOTICE
>>NOTICE: This message is intended for the use of the individual or entity
>>to
>>which it is addressed and may contain information that is confidential,
>>privileged and exempt from disclosure under applicable law. If the reader
>>of this message is not the intended recipient, you are hereby notified
>>that
>>any printing, copying, dissemination, distribution, disclosure or
>>forwarding of this communication is strictly prohibited. If you have
>>received this communication in error, please contact the sender
>>immediately
>>and delete it from your system. Thank You.
>



CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to which it is addressed and may contain information that is confidential, privileged and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any printing, copying, dissemination, distribution, disclosure or forwarding of this communication is strictly prohibited. If you have received this communication in error, please contact the sender immediately and delete it from your system. Thank You.


CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to which it is addressed and may contain information that is confidential, privileged and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any printing, copying, dissemination, distribution, disclosure or forwarding of this communication is strictly prohibited. If you have received this communication in error, please contact the sender immediately and delete it from your system. Thank You.

Re: stopping host components via API

Posted by Srimanth Gunturi <sr...@hortonworks.com>.
Hi Greg,
I would recommend putting the host in maintenance mode as shown in my API
call (PUT http://c6401:8080/api/v1/clusters/c1/hosts).

Also, can you please open a JIRA about this problem with your current API
usage?
Regards,
Srimanth



On Tue, Jul 22, 2014 at 5:16 AM, Greg Hill <gr...@rackspace.com> wrote:

>  Sure.  It's possible I'm doing something wrong.
>
>  Setting maintenance mode:
>
>  PUT /clusters/testcluster/hosts/
> c6401.ambari.apache.org/host_components?fields=HostRoles/state
>         {
>              "RequestInfo": {
>                 "context" :"Start Maintanence Mode",
>             },
>             "Body": {
>                 "HostRoles": {"maintenance_state": "ON"},
>             },
>         }
>
>  Stopping all components:
>
>  PUT /clusters/testcluster/hosts/
> c6401.ambari.apache.org/host_components?fields=HostRoles/state
>         {
>             "RequestInfo": {
>                 "context" :"Stop All Components",
>             },
>             "Body": {
>                 "HostRoles": {"state": "INSTALLED"},
>             },
>         }
>
>   From: Srimanth Gunturi <sr...@hortonworks.com>
> Reply-To: "user@ambari.apache.org" <us...@ambari.apache.org>
> Date: Monday, July 21, 2014 3:03 PM
> To: "user@ambari.apache.org" <us...@ambari.apache.org>
> Subject: Re: stopping host components via API
>
>   Hi Greg,
> Was wondering which version of Ambari you were using?
>
>  When maintenance mode is enabled on service, bulk host operations are
> ignored.
> When maintenance mode is enabled on hosts, service level operations are
> ignored on host.
> So was wondering if you enabled maintenance mode in one level, and
> performed operations on another?
>
>  I tried the following on trunk, and it stopped all host-components in
> maintenance mode.
> =========
> PUT http://c6401:8080/api/v1/clusters/c1/hosts
> {
>   "RequestInfo": {
>     "context": "Turn On Maintenance Mode for host",
>     "query": "Hosts/host_name.in(c6401.ambari.apache.org)"
>   },
>   "Body": {
>     "Hosts": {
>       "maintenance_state": "ON"
>     }
>   }
> }
> =========
> PUT
> http://c6401:8080/api/v1/clusters/c1/hosts/c6401.ambari.apache.org/host_components
> ?
> {
>   "RequestInfo": {
>     "context": "Stop All Host Components",
>     "operation_level": {
>       "level": "HOST",
>       "cluster_name": "c1",
>       "host_names": "c6401.ambari.apache.org"
>     },
>     "query": "HostRoles/component_name.in
> (APP_TIMELINE_SERVER,DATANODE,HISTORYSERVER,NAMENODE,NODEMANAGER,RESOURCEMANAGER,SECONDARY_NAMENODE,ZOOKEEPER_SERVER)"
>   },
>   "Body": {
>     "HostRoles": {
>       "state": "INSTALLED"
>     }
>   }
> }
> =========
>
>  Maybe listing the API calls you make might help.
> Regards,
> Srimanth
>
>
>
>
> On Mon, Jul 21, 2014 at 10:54 AM, Greg Hill <gr...@rackspace.com>
> wrote:
>
>> Anyone know if this is intentional or not?  It seems to ignore setting the
>> HostRole/state if the host_component is in maintenance mode.  I was able
>> to work around it by immediately setting maintenance mode after changing
>> the state. But that leads to a race condition as to whether nagios notices
>> the downed services before maintenance mode kicks in.
>>
>> IMO, it shouldn't behave this way.  There's no safe way to stop services
>> as it is right now.  It should let you stop them during maintenance, as
>> that's really the primary reason you'd want to set maintenance.
>>
>> Should I just open a bug?
>>
>> Greg
>>
>> On 7/21/14 8:02 AM, "Greg Hill" <gr...@RACKSPACE.COM> wrote:
>>
>> >I did some debugging and it turns out that the problem is that I set
>> >maintenance mode prior to stopping the components.  Unfortunately, this
>> >makes it so nagios starts alerting me.  My script is attempting to remove
>> >a slave node from a cluster by doing the following:
>> >
>> >1. Set maintenance mode on all host_components.
>> >2. Stop all host_components.
>> >3. Remove all host_components.
>> >4. Remove host from cluster.
>> >
>> >This was what I had worked out to be the proper procedure a few weeks
>> >back.  Am I doing something wrong or did I discover a bug?
>> >
>> >Greg
>> >
>> >
>> >On 7/18/14 7:15 PM, "Yusaku Sako" <yu...@hortonworks.com> wrote:
>> >
>> >>Greg,
>> >>
>> >>That should not be broken.
>> >>What is the exact call you are trying to make (can you post the
>> >>equivalent curl call)?
>> >>
>> >>Yusaku
>> >>
>> >>On Fri, Jul 18, 2014 at 2:13 PM, Greg Hill <gr...@rackspace.com>
>> >>wrote:
>> >>> This used to be accomplished by doing a PUT with this message to the
>> >>>host
>> >>> resource:
>> >>>
>> >>> {"RequestInfo": {"context" :"Stop All Components"}, "Body":
>> >>>{"HostRoles":
>> >>> {"state": "INSTALLED"}}}
>> >>>
>> >>> But that doesn't appear to work any more.  It worked a few weeks ago.
>> >>>Is
>> >>> there somewhere where changes like this are being documented?
>> >>>
>> >>> Greg
>> >>
>> >>--
>> >>CONFIDENTIALITY NOTICE
>> >>NOTICE: This message is intended for the use of the individual or entity
>> >>to
>> >>which it is addressed and may contain information that is confidential,
>> >>privileged and exempt from disclosure under applicable law. If the
>> reader
>> >>of this message is not the intended recipient, you are hereby notified
>> >>that
>> >>any printing, copying, dissemination, distribution, disclosure or
>> >>forwarding of this communication is strictly prohibited. If you have
>> >>received this communication in error, please contact the sender
>> >>immediately
>> >>and delete it from your system. Thank You.
>> >
>>
>>
>
> CONFIDENTIALITY NOTICE
> NOTICE: This message is intended for the use of the individual or entity
> to which it is addressed and may contain information that is confidential,
> privileged and exempt from disclosure under applicable law. If the reader
> of this message is not the intended recipient, you are hereby notified that
> any printing, copying, dissemination, distribution, disclosure or
> forwarding of this communication is strictly prohibited. If you have
> received this communication in error, please contact the sender immediately
> and delete it from your system. Thank You.
>
>

-- 
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to 
which it is addressed and may contain information that is confidential, 
privileged and exempt from disclosure under applicable law. If the reader 
of this message is not the intended recipient, you are hereby notified that 
any printing, copying, dissemination, distribution, disclosure or 
forwarding of this communication is strictly prohibited. If you have 
received this communication in error, please contact the sender immediately 
and delete it from your system. Thank You.

Re: stopping host components via API

Posted by Greg Hill <gr...@RACKSPACE.COM>.
Sure.  It's possible I'm doing something wrong.

Setting maintenance mode:

PUT /clusters/testcluster/hosts/c6401.ambari.apache.org/host_components?fields=HostRoles/state
       {
            "RequestInfo": {
                "context" :"Start Maintanence Mode",
            },
            "Body": {
                "HostRoles": {"maintenance_state": "ON"},
            },
        }

Stopping all components:

PUT /clusters/testcluster/hosts/c6401.ambari.apache.org/host_components?fields=HostRoles/state
       {
            "RequestInfo": {
                "context" :"Stop All Components",
            },
            "Body": {
                "HostRoles": {"state": "INSTALLED"},
            },
        }

From: Srimanth Gunturi <sr...@hortonworks.com>>
Reply-To: "user@ambari.apache.org<ma...@ambari.apache.org>" <us...@ambari.apache.org>>
Date: Monday, July 21, 2014 3:03 PM
To: "user@ambari.apache.org<ma...@ambari.apache.org>" <us...@ambari.apache.org>>
Subject: Re: stopping host components via API

Hi Greg,
Was wondering which version of Ambari you were using?

When maintenance mode is enabled on service, bulk host operations are ignored.
When maintenance mode is enabled on hosts, service level operations are ignored on host.
So was wondering if you enabled maintenance mode in one level, and performed operations on another?

I tried the following on trunk, and it stopped all host-components in maintenance mode.
=========
PUT http://c6401:8080/api/v1/clusters/c1/hosts
{
  "RequestInfo": {
    "context": "Turn On Maintenance Mode for host",
    "query": "Hosts/host_name.in<http://host_name.in>(c6401.ambari.apache.org<http://c6401.ambari.apache.org>)"
  },
  "Body": {
    "Hosts": {
      "maintenance_state": "ON"
    }
  }
}
=========
PUT http://c6401:8080/api/v1/clusters/c1/hosts/c6401.ambari.apache.org/host_components?
{
  "RequestInfo": {
    "context": "Stop All Host Components",
    "operation_level": {
      "level": "HOST",
      "cluster_name": "c1",
      "host_names": "c6401.ambari.apache.org<http://c6401.ambari.apache.org>"
    },
    "query": "HostRoles/component_name.in<http://component_name.in>(APP_TIMELINE_SERVER,DATANODE,HISTORYSERVER,NAMENODE,NODEMANAGER,RESOURCEMANAGER,SECONDARY_NAMENODE,ZOOKEEPER_SERVER)"
  },
  "Body": {
    "HostRoles": {
      "state": "INSTALLED"
    }
  }
}
=========

Maybe listing the API calls you make might help.
Regards,
Srimanth




On Mon, Jul 21, 2014 at 10:54 AM, Greg Hill <gr...@rackspace.com>> wrote:
Anyone know if this is intentional or not?  It seems to ignore setting the
HostRole/state if the host_component is in maintenance mode.  I was able
to work around it by immediately setting maintenance mode after changing
the state. But that leads to a race condition as to whether nagios notices
the downed services before maintenance mode kicks in.

IMO, it shouldn't behave this way.  There's no safe way to stop services
as it is right now.  It should let you stop them during maintenance, as
that's really the primary reason you'd want to set maintenance.

Should I just open a bug?

Greg

On 7/21/14 8:02 AM, "Greg Hill" <gr...@RACKSPACE.COM>> wrote:

>I did some debugging and it turns out that the problem is that I set
>maintenance mode prior to stopping the components.  Unfortunately, this
>makes it so nagios starts alerting me.  My script is attempting to remove
>a slave node from a cluster by doing the following:
>
>1. Set maintenance mode on all host_components.
>2. Stop all host_components.
>3. Remove all host_components.
>4. Remove host from cluster.
>
>This was what I had worked out to be the proper procedure a few weeks
>back.  Am I doing something wrong or did I discover a bug?
>
>Greg
>
>
>On 7/18/14 7:15 PM, "Yusaku Sako" <yu...@hortonworks.com>> wrote:
>
>>Greg,
>>
>>That should not be broken.
>>What is the exact call you are trying to make (can you post the
>>equivalent curl call)?
>>
>>Yusaku
>>
>>On Fri, Jul 18, 2014 at 2:13 PM, Greg Hill <gr...@rackspace.com>>
>>wrote:
>>> This used to be accomplished by doing a PUT with this message to the
>>>host
>>> resource:
>>>
>>> {"RequestInfo": {"context" :"Stop All Components"}, "Body":
>>>{"HostRoles":
>>> {"state": "INSTALLED"}}}
>>>
>>> But that doesn't appear to work any more.  It worked a few weeks ago.
>>>Is
>>> there somewhere where changes like this are being documented?
>>>
>>> Greg
>>
>>--
>>CONFIDENTIALITY NOTICE
>>NOTICE: This message is intended for the use of the individual or entity
>>to
>>which it is addressed and may contain information that is confidential,
>>privileged and exempt from disclosure under applicable law. If the reader
>>of this message is not the intended recipient, you are hereby notified
>>that
>>any printing, copying, dissemination, distribution, disclosure or
>>forwarding of this communication is strictly prohibited. If you have
>>received this communication in error, please contact the sender
>>immediately
>>and delete it from your system. Thank You.
>



CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to which it is addressed and may contain information that is confidential, privileged and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, you are hereby notified that any printing, copying, dissemination, distribution, disclosure or forwarding of this communication is strictly prohibited. If you have received this communication in error, please contact the sender immediately and delete it from your system. Thank You.

Re: stopping host components via API

Posted by Srimanth Gunturi <sr...@hortonworks.com>.
Hi Greg,
Was wondering which version of Ambari you were using?

When maintenance mode is enabled on service, bulk host operations are
ignored.
When maintenance mode is enabled on hosts, service level operations are
ignored on host.
So was wondering if you enabled maintenance mode in one level, and
performed operations on another?

I tried the following on trunk, and it stopped all host-components in
maintenance mode.
=========
PUT http://c6401:8080/api/v1/clusters/c1/hosts
{
  "RequestInfo": {
    "context": "Turn On Maintenance Mode for host",
    "query": "Hosts/host_name.in(c6401.ambari.apache.org)"
  },
  "Body": {
    "Hosts": {
      "maintenance_state": "ON"
    }
  }
}
=========
PUT
http://c6401:8080/api/v1/clusters/c1/hosts/c6401.ambari.apache.org/host_components
?
{
  "RequestInfo": {
    "context": "Stop All Host Components",
    "operation_level": {
      "level": "HOST",
      "cluster_name": "c1",
      "host_names": "c6401.ambari.apache.org"
    },
    "query": "HostRoles/component_name.in
(APP_TIMELINE_SERVER,DATANODE,HISTORYSERVER,NAMENODE,NODEMANAGER,RESOURCEMANAGER,SECONDARY_NAMENODE,ZOOKEEPER_SERVER)"
  },
  "Body": {
    "HostRoles": {
      "state": "INSTALLED"
    }
  }
}
=========

Maybe listing the API calls you make might help.
Regards,
Srimanth




On Mon, Jul 21, 2014 at 10:54 AM, Greg Hill <gr...@rackspace.com> wrote:

> Anyone know if this is intentional or not?  It seems to ignore setting the
> HostRole/state if the host_component is in maintenance mode.  I was able
> to work around it by immediately setting maintenance mode after changing
> the state. But that leads to a race condition as to whether nagios notices
> the downed services before maintenance mode kicks in.
>
> IMO, it shouldn't behave this way.  There's no safe way to stop services
> as it is right now.  It should let you stop them during maintenance, as
> that's really the primary reason you'd want to set maintenance.
>
> Should I just open a bug?
>
> Greg
>
> On 7/21/14 8:02 AM, "Greg Hill" <gr...@RACKSPACE.COM> wrote:
>
> >I did some debugging and it turns out that the problem is that I set
> >maintenance mode prior to stopping the components.  Unfortunately, this
> >makes it so nagios starts alerting me.  My script is attempting to remove
> >a slave node from a cluster by doing the following:
> >
> >1. Set maintenance mode on all host_components.
> >2. Stop all host_components.
> >3. Remove all host_components.
> >4. Remove host from cluster.
> >
> >This was what I had worked out to be the proper procedure a few weeks
> >back.  Am I doing something wrong or did I discover a bug?
> >
> >Greg
> >
> >
> >On 7/18/14 7:15 PM, "Yusaku Sako" <yu...@hortonworks.com> wrote:
> >
> >>Greg,
> >>
> >>That should not be broken.
> >>What is the exact call you are trying to make (can you post the
> >>equivalent curl call)?
> >>
> >>Yusaku
> >>
> >>On Fri, Jul 18, 2014 at 2:13 PM, Greg Hill <gr...@rackspace.com>
> >>wrote:
> >>> This used to be accomplished by doing a PUT with this message to the
> >>>host
> >>> resource:
> >>>
> >>> {"RequestInfo": {"context" :"Stop All Components"}, "Body":
> >>>{"HostRoles":
> >>> {"state": "INSTALLED"}}}
> >>>
> >>> But that doesn't appear to work any more.  It worked a few weeks ago.
> >>>Is
> >>> there somewhere where changes like this are being documented?
> >>>
> >>> Greg
> >>
> >>--
> >>CONFIDENTIALITY NOTICE
> >>NOTICE: This message is intended for the use of the individual or entity
> >>to
> >>which it is addressed and may contain information that is confidential,
> >>privileged and exempt from disclosure under applicable law. If the reader
> >>of this message is not the intended recipient, you are hereby notified
> >>that
> >>any printing, copying, dissemination, distribution, disclosure or
> >>forwarding of this communication is strictly prohibited. If you have
> >>received this communication in error, please contact the sender
> >>immediately
> >>and delete it from your system. Thank You.
> >
>
>

-- 
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to 
which it is addressed and may contain information that is confidential, 
privileged and exempt from disclosure under applicable law. If the reader 
of this message is not the intended recipient, you are hereby notified that 
any printing, copying, dissemination, distribution, disclosure or 
forwarding of this communication is strictly prohibited. If you have 
received this communication in error, please contact the sender immediately 
and delete it from your system. Thank You.

Re: stopping host components via API

Posted by Greg Hill <gr...@RACKSPACE.COM>.
Anyone know if this is intentional or not?  It seems to ignore setting the
HostRole/state if the host_component is in maintenance mode.  I was able
to work around it by immediately setting maintenance mode after changing
the state. But that leads to a race condition as to whether nagios notices
the downed services before maintenance mode kicks in.

IMO, it shouldn't behave this way.  There's no safe way to stop services
as it is right now.  It should let you stop them during maintenance, as
that's really the primary reason you'd want to set maintenance.

Should I just open a bug?

Greg

On 7/21/14 8:02 AM, "Greg Hill" <gr...@RACKSPACE.COM> wrote:

>I did some debugging and it turns out that the problem is that I set
>maintenance mode prior to stopping the components.  Unfortunately, this
>makes it so nagios starts alerting me.  My script is attempting to remove
>a slave node from a cluster by doing the following:
>
>1. Set maintenance mode on all host_components.
>2. Stop all host_components.
>3. Remove all host_components.
>4. Remove host from cluster.
>
>This was what I had worked out to be the proper procedure a few weeks
>back.  Am I doing something wrong or did I discover a bug?
>
>Greg
>
>
>On 7/18/14 7:15 PM, "Yusaku Sako" <yu...@hortonworks.com> wrote:
>
>>Greg,
>>
>>That should not be broken.
>>What is the exact call you are trying to make (can you post the
>>equivalent curl call)?
>>
>>Yusaku
>>
>>On Fri, Jul 18, 2014 at 2:13 PM, Greg Hill <gr...@rackspace.com>
>>wrote:
>>> This used to be accomplished by doing a PUT with this message to the
>>>host
>>> resource:
>>>
>>> {"RequestInfo": {"context" :"Stop All Components"}, "Body":
>>>{"HostRoles":
>>> {"state": "INSTALLED"}}}
>>>
>>> But that doesn't appear to work any more.  It worked a few weeks ago.
>>>Is
>>> there somewhere where changes like this are being documented?
>>>
>>> Greg
>>
>>-- 
>>CONFIDENTIALITY NOTICE
>>NOTICE: This message is intended for the use of the individual or entity
>>to 
>>which it is addressed and may contain information that is confidential,
>>privileged and exempt from disclosure under applicable law. If the reader
>>of this message is not the intended recipient, you are hereby notified
>>that 
>>any printing, copying, dissemination, distribution, disclosure or
>>forwarding of this communication is strictly prohibited. If you have
>>received this communication in error, please contact the sender
>>immediately 
>>and delete it from your system. Thank You.
>


Re: stopping host components via API

Posted by Greg Hill <gr...@RACKSPACE.COM>.
I did some debugging and it turns out that the problem is that I set
maintenance mode prior to stopping the components.  Unfortunately, this
makes it so nagios starts alerting me.  My script is attempting to remove
a slave node from a cluster by doing the following:

1. Set maintenance mode on all host_components.
2. Stop all host_components.
3. Remove all host_components.
4. Remove host from cluster.

This was what I had worked out to be the proper procedure a few weeks
back.  Am I doing something wrong or did I discover a bug?

Greg


On 7/18/14 7:15 PM, "Yusaku Sako" <yu...@hortonworks.com> wrote:

>Greg,
>
>That should not be broken.
>What is the exact call you are trying to make (can you post the
>equivalent curl call)?
>
>Yusaku
>
>On Fri, Jul 18, 2014 at 2:13 PM, Greg Hill <gr...@rackspace.com>
>wrote:
>> This used to be accomplished by doing a PUT with this message to the
>>host
>> resource:
>>
>> {"RequestInfo": {"context" :"Stop All Components"}, "Body":
>>{"HostRoles":
>> {"state": "INSTALLED"}}}
>>
>> But that doesn't appear to work any more.  It worked a few weeks ago.
>>Is
>> there somewhere where changes like this are being documented?
>>
>> Greg
>
>-- 
>CONFIDENTIALITY NOTICE
>NOTICE: This message is intended for the use of the individual or entity
>to 
>which it is addressed and may contain information that is confidential,
>privileged and exempt from disclosure under applicable law. If the reader
>of this message is not the intended recipient, you are hereby notified
>that 
>any printing, copying, dissemination, distribution, disclosure or
>forwarding of this communication is strictly prohibited. If you have
>received this communication in error, please contact the sender
>immediately 
>and delete it from your system. Thank You.


Re: stopping host components via API

Posted by Yusaku Sako <yu...@hortonworks.com>.
Greg,

That should not be broken.
What is the exact call you are trying to make (can you post the
equivalent curl call)?

Yusaku

On Fri, Jul 18, 2014 at 2:13 PM, Greg Hill <gr...@rackspace.com> wrote:
> This used to be accomplished by doing a PUT with this message to the host
> resource:
>
> {"RequestInfo": {"context" :"Stop All Components"}, "Body": {"HostRoles":
> {"state": "INSTALLED"}}}
>
> But that doesn't appear to work any more.  It worked a few weeks ago.  Is
> there somewhere where changes like this are being documented?
>
> Greg

-- 
CONFIDENTIALITY NOTICE
NOTICE: This message is intended for the use of the individual or entity to 
which it is addressed and may contain information that is confidential, 
privileged and exempt from disclosure under applicable law. If the reader 
of this message is not the intended recipient, you are hereby notified that 
any printing, copying, dissemination, distribution, disclosure or 
forwarding of this communication is strictly prohibited. If you have 
received this communication in error, please contact the sender immediately 
and delete it from your system. Thank You.