Support Questions

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

Ambari Custom Service Upgrade & Hooks

avatar
New Contributor

Hi All,

I have written a custom service and i am able to run it successfully using Ambari.

But now want to understand about

How do i go about upgrade it? Does Ambari provide some support to do this OR i have to write some custom command to do that OR i need to do it manually? Is the RPM package recommended practice for Ambari custom components in this case?

Also in the source code i saw that there is a support for hooks. How do i implement hooks?

How to get existing services configurations(e.g. HDFS, YARN), installation homes to define classpath? Do i have to use the REST services?

Thanks & Regards,

Abhijit

1 ACCEPTED SOLUTION

avatar

+ @Alejandro Fernandez @smohanty

For sample upgrade code for Ambari services, you can look at existing Ambari services for example of this. In Hbase master service, you will find the method to be overridden:

https://github.com/apache/ambari/blob/trunk/ambari...

Here is the upgrade class being called:

https://github.com/apache/ambari/blob/trunk/ambari...

To get configurations from components of existing services, you can use the config object to do this in params.py. In the above Hbase example, you can see some samples here

https://github.com/apache/ambari/blob/trunk/ambari...

Some code samples of more basic Ambari services are available below..these may be useful for those getting started with building services (but so far they don't implement the upgrade hooks)

http://hortonworks.com/partners/learn/#ambari

For more details on how rolling/express upgrades work from end user perspective, you can check the below article

https://community.hortonworks.com/articles/2473/ro...

View solution in original post

4 REPLIES 4

avatar

+ @Alejandro Fernandez @smohanty

For sample upgrade code for Ambari services, you can look at existing Ambari services for example of this. In Hbase master service, you will find the method to be overridden:

https://github.com/apache/ambari/blob/trunk/ambari...

Here is the upgrade class being called:

https://github.com/apache/ambari/blob/trunk/ambari...

To get configurations from components of existing services, you can use the config object to do this in params.py. In the above Hbase example, you can see some samples here

https://github.com/apache/ambari/blob/trunk/ambari...

Some code samples of more basic Ambari services are available below..these may be useful for those getting started with building services (but so far they don't implement the upgrade hooks)

http://hortonworks.com/partners/learn/#ambari

For more details on how rolling/express upgrades work from end user perspective, you can check the below article

https://community.hortonworks.com/articles/2473/ro...

avatar
New Contributor

Thanks @Ali Bajwa for the pointers!!

avatar

Most welcome! Btw just curious: what kind of Ambari service are you working on? Is the code up on git somewhere?

avatar
New Contributor

It is for one of the big data analytics product that we are building. Its not on git but in private repo.