Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

service autostart with a notification

avatar

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!

1 ACCEPTED SOLUTION

avatar
Master Mentor

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

.

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.

View solution in original post

8 REPLIES 8

avatar
Master Mentor

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

.

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.

avatar

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.

avatar
Master Mentor

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

avatar

So if i add email notifications or such i will still receive them before the autostart takes place?

avatar
Master Mentor

@Matas Mockus

Alert notification is not related with the Service Auto Start feature. Those features will work separately.

So if you have configured any notification like Email Alert Notification then once the component goes down the alert will still be triggered normally based ont he alert trigger interval set for those individual alerts telling that the component went down (Service Auto Start feature will work independently).




avatar
Master Mentor

@Matas Mockus
Do you have any additional query that you have as part of this HCC thread?

avatar
Master Mentor

@Matas Mockus

If this answers your query then can you please close this HCC thread by clicking on the "Accept" button on the helpful answer.

avatar

No thanks @Jay