Skip to content

Latest commit

 

History

History
161 lines (137 loc) · 4.56 KB

host-component-resources.md

File metadata and controls

161 lines (137 loc) · 4.56 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 parent 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.

State Description
INIT The initial clean state after the component is first created.
INSTALLING In the process of installing the component.
INSTALL_FAILED The component install failed.
INSTALLED The component has been installed successfully but is not currently running.
STARTING In the process of starting the component.
STARTED The component has been installed and started.
STOPPING In the process of stopping the component.
UNINSTALLING In the process of uninstalling the component.
UNINSTALLED The component has been successfully uninstalled.
WIPING_OUT In the process of wiping out the installed component.
UPGRADING In the process of upgrading the component.
MAINTENANCE The component has been marked for maintenance.
UNKNOWN The component state can not be determined.

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.