Support Questions

Find answers, ask questions, and share your expertise

Stack Advisor - how to use it?

avatar
Expert Contributor

Hi. I have a question regarding Stack Advisor script. I want to tune my cluster - change YARN, Tez and Hive configuration files. I can use hdp-configuration-utils.py script, but it is too simple. I read that there is stack and service advisors which can give me recommendations. My question is - can I use stack advisor script after HDP installation or I should not use it, cause Ambari uses it during HDP installation only? And if I can use it - how can I do this?

1 ACCEPTED SOLUTION

avatar
Super Guru

@Mateusz Grabowski,

You can make the required changes in stack_advisor.py under (/var/lib/ambari-server/resources/stacks/HDP/{HDP version}/services/stack_advisor.py

For testing, I have changed a line in ( /var/lib/ambari-server/resources/stacks/HDP/2.5/services/stack_advisor.py.

I have hardcoded the port no in atlas.rest.address to 12233 and restarted the ambari server.

39833-screen-shot-2017-10-17-at-93633-pm.png

As you can see in the below screenshot, it got reflected in the UI.

39834-screen-shot-2017-10-17-at-93900-pm.png

All you have to do is make the changes you want in stack_advisor.py , restart ambari-server. We need not run the file manually.

Note : Ambari agents will cache these files. So you should make the same change in (/var/lib/ambari-agent/cache/stacks/HDP/{HDP version}/services/stack_advisor.py) as well.

You can check this link for some more info

Hope this helps 🙂

Thanks,

Aditya

View solution in original post

4 REPLIES 4

avatar
Expert Contributor

I saw both of this sites. But my question is - how I can run stack-advisor.py script? Can I just run simple:

python stack-advisor.py

or I should configure something before? Where I can find a file with recommendations?

avatar
Super Guru

@Mateusz Grabowski,

You can make the required changes in stack_advisor.py under (/var/lib/ambari-server/resources/stacks/HDP/{HDP version}/services/stack_advisor.py

For testing, I have changed a line in ( /var/lib/ambari-server/resources/stacks/HDP/2.5/services/stack_advisor.py.

I have hardcoded the port no in atlas.rest.address to 12233 and restarted the ambari server.

39833-screen-shot-2017-10-17-at-93633-pm.png

As you can see in the below screenshot, it got reflected in the UI.

39834-screen-shot-2017-10-17-at-93900-pm.png

All you have to do is make the changes you want in stack_advisor.py , restart ambari-server. We need not run the file manually.

Note : Ambari agents will cache these files. So you should make the same change in (/var/lib/ambari-agent/cache/stacks/HDP/{HDP version}/services/stack_advisor.py) as well.

You can check this link for some more info

Hope this helps 🙂

Thanks,

Aditya

avatar
Rising Star

You can use the below snippet. But you need to run stack_advisor once using normal flow under ambari server

/var/lib/ambari-server/resources/scripts/stack_advisor.py recommend-configurations /var/run/ambari-server/stack-recommendations/1/hosts.json /var/run/ambari-server/stack-recommendations/1/services.json