...
Ambari auto start is a feature that enables certain components to be marked for auto start so that whenever a node restarts, ambari agent automatically restarts the stopped components. Auto start of a component is based on its current state and desired state.
...
Ambari 2.
...
3.x/2.2.x (see here)
Auto start of services and components is supported via ambari.properties file using several properties. However, this approach is static - anytime auto start for a service component is required to be turned on or off, these properties in ambari.properties have to be modified and ambari server has to be restarted for the changes to go into effect. Moreover, ambari agent has to be restarted so that it can bootstrap with the server to get the auto start configuration.
Ambari 2.4.0+ (see here)
Auto start is dynamic. No restart of ambari server or ambari agent is required for any changes to take effect. All auto start properties reside in the database. API support has been added to configure the auto start setting for services and have ambari server communicate the changes to the ambari agents during the subsequent registration or heartbeat. Ambari web (UI) uses the APIs to dynamically control the auto start settings.
Anchor Pre240 Pre240
How auto start works in Ambari versions
Pre240 | |
Pre240 |
...
2.3.x/2.
...
2.
...
x
When an ambari agent starts, it bootstraps with the ambari server via registration. The server sends information to the agent about the components that have been enabled for auto start along with the other auto start properties in ambari.properties. The agent compares the current state of these components against the desired state, to determine if these components are to be installed, started, restarted or stopped.
...
Current state | Desired state | Recovery command | Recovery mode | Remarks |
INSTALLED | STARTED | Start | AUTO_START | Start a component |
INSTALLED | STARTED | Start | FULL | Start a component |
INSTALLED | INSTALLED | Install | FULL | Stale component configurations. |
INIT | STARTED | Install | FULL | Start a component |
INIT | INSTALLED | Install | FULL | Install a component |
STARTED | STARTED | Restart | FULL | Stale component configurations |
STARTED | INSTALLED | Stop | FULL | Stop a component |
Anchor 240Onwards 240Onwards
How auto start works in Ambari version 2.4.0
240Onwards | |
240Onwards |
Recovery scenarios
Please note that only Auto start recovery mode is supported, i.e., components that are in INSTALLED state can be transitioned to STARTED state. Ambari server sends the AUTO_START value for recovery type to the agent. Sample recovery configuration sent by the server to the agent:
...
Blueprint based deployments
Microsoft uses For blueprints for deployment (headless deployments). Blueprints do not have any room for specifying settings properties. Blueprint schema will have to be modified to accommodate settings. All components are auto started.
...
Specify a set or all of the components to be auto started. If it is a set, then explicitly call out the list of components. For all components, specify * since we don’t know the list of all components.recovery_enabled="true" at the cluster level:
"settings" : [{
"recovery_settings" : [{
"recovery_enabled" : "true"
}
]}
],
"Blueprints" : {
"stack_name" : "HDP",
"stack_version" : "2.5"
}
}
Specify METRICS_COLLECTOR as the default auto started component in both UI and blueprint, in the stack definition, with the ability for the blueprint authors to remove METRICS_COLLECTOR from getting auto start.
...
The components member contains a list of components enabled for auto start and not in maintenance mode.
...
Heartbeat
If the auto start value for one or more components changes and/or the cluster-env level recovery properties change, the above JSON is constructed with the changed components and sent to the agent during the subsequent heartbeat.
...