Skip to main content
matas_mockus
Silver ⭐️⭐️
June 10, 2019
Solved

service autostart with a notification

Hello, im currently an intern and was given a task to automate a hadoop cluster. It should auto start the component once its down and alert the user (email or similar) that the node was autostarted. How would i go about doing this? Thanks in advance!

jsensharma
Platinum ⭐️⭐️
June 10, 2019

@Matas Mockus

Ambari provides Auto Start feature for the component which went down abnormally.


https://docs.hortonworks.com/HDPDocuments/Ambari-2.7.3.0/managing-and-monitoring-ambari/content/amb_enable_service_auto_start_from_ambari_web.html

.

You can configure the ambari agent as a service so that it gets restarted upon System Reboot. And once the Ambari Agent is UP and running then it will keep sending the current state of other components to the Ambari Server. If those component went down abruptly then in Ambari DB the desired state for those component will be "Started" but those components are actually Down. So the Auto start will work in this case.

Auto start of a component is based on its current state and "desired state". But if you manually stop the services/components then the auto start will not work because the ambari agent compares the current state of these components against the desired state which is stored inside the Ambari DB for that component, to determine if these components are to be installed, started, restarted or stopped.

8 replies

jsensharma
Platinum ⭐️⭐️
Platinum ⭐️⭐️
June 10, 2019

@Matas Mockus

Ambari provides Auto Start feature for the component which went down abnormally.


https://docs.hortonworks.com/HDPDocuments/Ambari-2.7.3.0/managing-and-monitoring-ambari/content/amb_enable_service_auto_start_from_ambari_web.html

.

You can configure the ambari agent as a service so that it gets restarted upon System Reboot. And once the Ambari Agent is UP and running then it will keep sending the current state of other components to the Ambari Server. If those component went down abruptly then in Ambari DB the desired state for those component will be "Started" but those components are actually Down. So the Auto start will work in this case.

Auto start of a component is based on its current state and "desired state". But if you manually stop the services/components then the auto start will not work because the ambari agent compares the current state of these components against the desired state which is stored inside the Ambari DB for that component, to determine if these components are to be installed, started, restarted or stopped.

Translate
matas_mockus
Silver ⭐️⭐️
June 10, 2019

Thanks a lot Jay, I did it according to the page you sent in but manually turned of the nodes to test it which didnt seem to give me a reply, and in turn I taught i did it wrong.

Translate
jsensharma
Platinum ⭐️⭐️
Platinum ⭐️⭐️
June 10, 2019

@Matas Mockus

Auto Start of components should work if the following conditions are met:


1. The components were not gracefully stopped (via Ammari API calls or via UI). Means the components were abruptly killed/terminated due to Host reboot or due to some errors in those componentes.


2. As soon as the Host comes up at least Ambari Agent should be running as a service so that as soon as the host reboots the Ambari Agent comes up automatically. This is needed because the Ambari Agent sends the current state info of the components present in that host to Ambari Server and then Ambari checks the "desired state" of the components with the "actual State" of those components sent by the ambari agent.


If the desired state of those component does not match (support in ambari DB the desired state is "STARTED" but agent says that those components are actually Down) then Ambari Server will send a recovery instruction to agents due to the AutoStart Setting.

Translate
matas_mockus
Silver ⭐️⭐️
June 13, 2019

No thanks @Jay

Translate