Support Questions
Find answers, ask questions, and share your expertise

How to ask Ambari service to start automatically

Solved Go to solution
Highlighted

How to ask Ambari service to start automatically

Explorer

I'm implementing the Ambari service and need to have it started aotumatically after cluster was started. Is there some option in metainfo.xml to enable this?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: How to ask Ambari service to start automatically

Super Mentor

@Volodymyr Ostapiv

You may want to refer to the following article which talks about a new feature added to ambari 2.4 in order to have dynamic auto-recovery, which allows auto-start properties to be configured without needing an ambari-agent / ambari-server restart.

https://community.hortonworks.com/content/kbentry/71748/how-do-i-enable-automatic-restart-recovery-o...

Example: {"recovery_enabled":"true"}

curl -u admin:<password> -H "X-Requested-By: ambari" -X PUT 'http://localhost:8080/api/v1/clusters/<cluster_name>/components?ServiceComponentInfo/component_name.in(HBASE_REGIONSERVER)' -d '{"ServiceComponentInfo" : {"recovery_enabled":"true"}}'

In the above curl call you can define your own service component. Above will help in setting auto start in case of host reboot.

Also for your custom service you may customize your scripts like "package/scripts" to have your own desired start feature.

- You can take a look at the "metainfo.xml" file of AMS something like following 'recovery_enabled':

    <component>
         <name>METRICS_COLLECTOR</name>
         <displayName>Metrics Collector</displayName>
         <category>MASTER</category>
         <recovery_enabled>true</recovery_enabled>

- More info regarding this feature for ambari 2.4.x (and prior versions can be found at:

https://cwiki.apache.org/confluence/display/AMBARI/Recovery%3A+auto+start+components )

.

View solution in original post

3 REPLIES 3
Highlighted

Re: How to ask Ambari service to start automatically

@Volodymyr Ostapiv

After adding a service you wanted to start that service automatically? May be you can include the start script/command in the install section itself.

Re: How to ask Ambari service to start automatically

Explorer

Nope, it is already started. But if cluster restarts (e.g. power outage) my service is down and needs to be started manualy

Highlighted

Re: How to ask Ambari service to start automatically

Super Mentor

@Volodymyr Ostapiv

You may want to refer to the following article which talks about a new feature added to ambari 2.4 in order to have dynamic auto-recovery, which allows auto-start properties to be configured without needing an ambari-agent / ambari-server restart.

https://community.hortonworks.com/content/kbentry/71748/how-do-i-enable-automatic-restart-recovery-o...

Example: {"recovery_enabled":"true"}

curl -u admin:<password> -H "X-Requested-By: ambari" -X PUT 'http://localhost:8080/api/v1/clusters/<cluster_name>/components?ServiceComponentInfo/component_name.in(HBASE_REGIONSERVER)' -d '{"ServiceComponentInfo" : {"recovery_enabled":"true"}}'

In the above curl call you can define your own service component. Above will help in setting auto start in case of host reboot.

Also for your custom service you may customize your scripts like "package/scripts" to have your own desired start feature.

- You can take a look at the "metainfo.xml" file of AMS something like following 'recovery_enabled':

    <component>
         <name>METRICS_COLLECTOR</name>
         <displayName>Metrics Collector</displayName>
         <category>MASTER</category>
         <recovery_enabled>true</recovery_enabled>

- More info regarding this feature for ambari 2.4.x (and prior versions can be found at:

https://cwiki.apache.org/confluence/display/AMBARI/Recovery%3A+auto+start+components )

.

View solution in original post