[
https://issues.apache.org/jira/browse/AMBARI-18435?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15736154#comment-15736154
]
Alejandro Fernandez commented on AMBARI-18435:
----------------------------------------------
Here's the API call to remove older versions. E.g.,
{code}
curl 'http://c6401.ambari.apache.org:8080/api/v1/clusters/cl1/requests' -u
admin:admin -H "X-Requested-By: ambari" -X POST
-d'{"RequestInfo":{"context":"remove_previous_stacks", "action" :
"remove_previous_stacks", "parameters" : {"version":"2.5.0.0-1245"}},
"Requests/resource_filters": [{"hosts":"c6403.ambari.apache.org,
c6402.ambari.apache.org"}]}'
{code}
That removes all versions older than "2.5.0.0-1245". Version mentioned in
request remains intact. We also have checks that prevent removing the current
version and the operation is idempotent.
> Provide script to delete an old HDP stack version
> -------------------------------------------------
>
> Key: AMBARI-18435
> URL: https://issues.apache.org/jira/browse/AMBARI-18435
> Project: Ambari
> Issue Type: Task
> Components: ambari-server
> Reporter: Dmitry Lysnichenko
> Assignee: Dmitry Lysnichenko
> Attachments: AMBARI-18435.patch
>
>
> We need a script or hacky solution internally for base-cluster to be able to
> delete old HDP stacks.
> This does not need to be a full-blown feature with tons of bells and whistles
> and UI support.
> Instead, it needs to be a simple script that can be ran on all hosts.
> Ideally, it would accept the version of the stack to remove, and perhaps can
> go into contrib.
> If we want to make it slightly better, than we can figure out how to actually
> make it a custom command to remove older versions (value is less than the
> CURRENT version).
> If done this way, we can add checks to make it more robust, bubble up errors
> to the UI task output, etc.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)