Created on 11-29-2017 06:13 PM - edited 08-17-2019 10:05 PM
from
hdfs dfs -du -h /
we see that spark history take a lot space from HDFS
from ambari GUI
I choose spark
and then quick links
and then I get the history server page with all applications
I want to delete all applications from the page
how to do it because I not see the delete button ?
second
is it possible to delete the application that use hdfs by API or CLI ?
Created 11-29-2017 06:41 PM
If you want to delete applications in spark2
hdfs dfs -rm -R /spark2-history/{app-id}
If you want to delete applications in spark1
hdfs dfs -rm -R /spark-history/{app-id}
Restart history servers after running the commands.
Thanks,
Aditya
Created 11-29-2017 07:34 PM
I try this but get errors ( what is wrong in my syntax ? ) , ( master02 is the name of park-history server )
.
curl -sH "X-Requested-By: ambari" -u admin:admin -i curl http://master02:8080/api/v1/applications
.
HTTP/1.1 404 Not Found
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Created 11-29-2017 07:45 PM
I see that you are using port 8080.
For spark history server port is 18080 by default
for spark2 history server port is 18081 by default. You can check the port in UI where you saw the applications
Created 11-29-2017 07:57 PM
ok , now I am using this:
.
curl -sH "X-Requested-By: ambari" -u "$API_USER"":""$API_PASSWORD" -i curl http://master02:18081/api/v1/applications
.
but no any output from command
what its wrong ?
Created 11-29-2017 08:03 PM
Run this command as is. No need to append headers and password. In above command you were using curl twice.
curl http://master02:18081/api/v1/applications | grep "\"id\"" > a.txt
Created 01-05-2020 05:39 AM