- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Delete application logs from spark history specifying date
- Labels:
-
Apache Spark
Created on
09-14-2023
12:44 PM
- last edited on
09-21-2023
07:24 AM
by
cjervis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
from
hdfs dfs -du -h /
we see that spark history take a lot space from HDFS
I want delete only some that I specified for example all that are of the year 2019 and 2019, and keep the rest.
If I use the command
hdfs dfs -rm -R /spark2-history/*
this delete all and I want not delete all.
Thanks
Created on 09-14-2023 06:09 PM - edited 09-14-2023 06:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Emanuel_MXN
Generally not recommended to keep event logs older than some days/months. In your case, you are keeping logs for years.
To avoid keeping the old logs, please add the following parameters to the spark-defaults.conf file and delete old event logs based on your need.
spark.history.fs.cleaner.enabled true
spark.history.fs.cleaner.maxAge 7d
spark.history.fs.cleaner.interval 1h
I don't have any handy script to delete files from hdfs for specific date/year. If i found definetely i will share it here.
Created on 09-14-2023 06:09 PM - edited 09-14-2023 06:32 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @Emanuel_MXN
Generally not recommended to keep event logs older than some days/months. In your case, you are keeping logs for years.
To avoid keeping the old logs, please add the following parameters to the spark-defaults.conf file and delete old event logs based on your need.
spark.history.fs.cleaner.enabled true
spark.history.fs.cleaner.maxAge 7d
spark.history.fs.cleaner.interval 1h
I don't have any handy script to delete files from hdfs for specific date/year. If i found definetely i will share it here.
Created 09-26-2023 02:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@Emanuel_MXN, Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.
Regards,
Vidya Sargur,Community Manager
Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:
