- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
List all the installed mPacks in Ambari
- Labels:
-
Apache Ambari
Created 10-06-2017 06:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try listing the installed packages using yum command:
yum list installed | grep mpack
Created 10-06-2017 06:29 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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