Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Ambari 2.4: How to add/delete/modify new property dynamically via service_advisor in a custom service?

Ambari 2.4: How to add/delete/modify new property dynamically via service_advisor in a custom service?

New Contributor

@Swapan Shridhar

Hi

I refereed to your solution for changing configurations for custom services

https://community.hortonworks.com/questions/46592/how-can-i-change-a-config-during-the-setup-of-a-ne...

I have few questions around that:

1)When is stack_advisor.py called in a service's life-cycle?

2)Now that stack_advisor is split into service_advisor in Ambari 2.4, is your solution for changing configuration still valid or some changes has to be made to make it work?

I have tried your solution with a TEST service.Attached the service zip file.

test.zip

-TEST service has test-env with 1 property app_name.

-It has service_advisor.py file where I read properties from test-env.xml and if any new property is found , it is added to the service's existing configuration using putProperty() method of parent stack_advisor.

-I test this by adding new property app_name2 into test-env and replace it with existing test-env ,after the service is already installed.

test-env.xml

-I am able to see recommendations call being made by inspecting element in browser and it has the new property app_name2.But I don't see new property added in configuration UI.

screenshot-from-2016-10-14-202447.png

2 REPLIES 2

Re: Ambari 2.4: How to add/delete/modify new property dynamically via service_advisor in a custom service?

Explorer

I am also facing the same issue. I am modifying the pig-env through service advisory which will get reflected in the file created under "Stack-recommendation" but nothing has been modified in the UI & while running the pig query changes is not get reflected in the pig classpath.

@Ali Bajwa @Ajaysingh

Re: Ambari 2.4: How to add/delete/modify new property dynamically via service_advisor in a custom service?

New Contributor

Once the ServiceAdvisor implementation for your service is successfully loaded, you just need to go to the configuration UI and click the Set Recommended button besides your config file ( a small blue circular arrow shaped), which then loads the recommended property in your config file. I tried and it worked for me.