incubator-ambari-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Beerbower <tbeerbo...@hortonworks.com>
Subject Re: How to update service state on specific hosts?
Date Tue, 08 Oct 2013 20:22:15 GMT
Hi Christian,

If I understand correctly you want to set the state of a component on a 
specific host.  If so, here is an example from the docs ...

Start the NAMENODE component by updating its state to 'STARTED'.

PUT api/v1/clusters/c1/hosts/hostname/host_components/NAMENODE

{
   "HostRoles":{
     "state":"STARTED"
   }
}


202 Accepted
{
   "href" : "http://your.ambari.server:8080/api/v1/clusters/c1/requests/12",
   "Requests" : {
     "id" : 12,
     "status" : "InProgress"
   }
}


Thanks,
Tom


On 10/8/13 4:13 PM, Christian Smith wrote:
> Hi,
>
> I have a scenario where I have an existing cluster with all the 
> services installed and started.  I then add one or more slaves to the 
> existing cluster.
>
> I'm wondering if there' s an easy way for me to set the 
> service/component states to INSTALLED then STARTED just for the new 
> hosts?  When installing the cluster I use something like PUT 
> state=INSTALLED to 
> /api/v1/clusters/c1/services?ServiceInfo/state=INIT, but obviously I 
> can't use this on a running cluster.
>
> I've tried various predicates like selecting just the hostnames I need 
> for a component, but the predicate isn't supported.
>
> For example, this fails
>
> /api/v1/clusters/c1/services/HDFS/components/DATANODE?host_components/HostRoles/host_name=my-hostname
>
> I know I can iterate through each host, but this is slow...
>
> Thanks in advance,
> Christian


-- 
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.

Mime
View raw message