host-component-resources.md 4.6 KB

Host Component Resources

###API Summary

###Properties

Property Description
HostRoles/role_id The host component id
HostRoles/cluster_name The name of the parent cluster
HostRoles/host_name The name of the parent host
HostRoles/component_name The name of the parenbt component
HostRoles/state The state of the host component
HostRoles/actual_configs The actual configuration
HostRoles/desired_configs The desired configuration
HostRoles/stack_id The stack id (e.g. HDP-1.3.0)

###States

The current state of a host component resource can be determined by looking at the ServiceComponentInfo/state property.

GET api/v1/clusters/c1/services/HDFS/components/NAMENODE?fields=ServiceComponentInfo/state

200 OK
{
  "href" : "http://your.ambari.server/api/v1/clusters/c1/services/HDFS/components/NAMENODE?fields=ServiceComponentInfo/state",
  "ServiceComponentInfo" : {
    "cluster_name" : "c1",
    "component_name" : "NAMENODE",
    "state" : "INSTALLED",
    "service_name" : "HDFS"
  }
}

The following table lists the possible values of the service resource ServiceComponentInfo/state property.

<th>State</th>
<th>Description</th>

<td>INIT</td>
<td>The initial clean state after the component is first created.</td>  

<td>INSTALLING</td>
<td>In the process of installing the component.</td>  

<td>INSTALL_FAILED</td>
<td>The component install failed.</td>  

<td>INSTALLED</td>
<td>The component has been installed successfully but is not currently running.</td>  

<td>STARTING</td>
<td>In the process of starting the component.</td>  

<td>STARTED</td>
<td>The component has been installed and started.</td>  

<td>STOPPING</td>
<td>In the process of stopping the component.</td>  

<td>UNINSTALLING</td>
<td>In the process of uninstalling the component.</td>  

<td>UNINSTALLED</td>
<td>The component has been successfully uninstalled.</td>  

<td>WIPING_OUT</td>
<td>In the process of wiping out the installed component.</td>  

<td>UPGRADING</td>
<td>In the process of upgrading the component.</td>  

<td>MAINTENANCE</td>
<td>The component has been marked for maintenance.</td>  

<td>UNKNOWN</td>
<td>The component state can not be determined.</td>  

###Starting a Host Component A component can be started through the API by setting its state to be STARTED (see update host component).

###Stopping a Host Component A component can be stopped through the API by setting its state to be INSTALLED (see update host component).

###Maintenance

The user can update the desired state of a host component through the API to be MAINTENANCE (see update host component). When a host component is into maintenance state it is basically taken off line. This state can be used, for example, to move a component like NameNode. The NameNode component can be put in MAINTENANCE mode and then a new NameNode can be created for the service.