Created 10-06-2017 06:18 AM
How can I list all the installed Mpacks in ambari. I want to install few mPacks and uninstall mPack asks for the mpack name. I want to check all the installed mpacks and uninstall few.
Thanks,
Aditya
Created 10-08-2017 05:23 AM
Found out the solution. This is not a single line command though
1) Find out the mpack.staging.path by running
cat /etc/ambari-server/conf/ambari.properties | grep -i mpack
2) Go to the mpack.staging.path directory (default is : /var/lib/ambari-server/resources/mpacks )
cd /var/lib/ambari-server/resources/mpacks
3) Iterate through all the directories in the mpack staging directory excpet the "cache" directory and read the mpack.json in each directory
The mpack.json has the name of the mPack.
You can write a small script to iterate through the directories and print all the mpack names
Thanks,
Aditya
Created 10-06-2017 06:25 AM
Try listing the installed packages using yum command:
yum list installed | grep mpack
Created 10-06-2017 06:29 AM
Hi @Sindhu,
I'm sorry, my question was not so clear. I was trying to list all the installed mPacks in ambari which we usually install using
ambari-server install-mpack <args>
Created 10-08-2017 05:23 AM
Found out the solution. This is not a single line command though
1) Find out the mpack.staging.path by running
cat /etc/ambari-server/conf/ambari.properties | grep -i mpack
2) Go to the mpack.staging.path directory (default is : /var/lib/ambari-server/resources/mpacks )
cd /var/lib/ambari-server/resources/mpacks
3) Iterate through all the directories in the mpack staging directory excpet the "cache" directory and read the mpack.json in each directory
The mpack.json has the name of the mPack.
You can write a small script to iterate through the directories and print all the mpack names
Thanks,
Aditya
Created on 07-30-2020 08:55 AM - edited 07-30-2020 09:45 AM
brutal I know but a oneliner
cd $(cat /etc/ambari-server/conf/ambari.properties | grep -i mpack|awk -F'=' '{print$2}') ; ls -l|grep -v cache |grep -v mpacks_replay.log |grep -v total |awk '{print$9}' |xargs
The last bit is handy if you to create a ruby fact out of the data