从nfs位置删除超过7天的Spark History Server日志


api.name: spark-history-server
file.upload.path: x
gcp.server.property.file.path: x
git.files.update.path: x
onprem.server.property.file.path: x
preferred.id.deployment.file.path: x
preferred.id.file.path: x
server.error.whitelabel.enabled: "false"
server.port: "18080"
server.property.file.path: x
server.servlet.context-path: /
spark.history.fs.cleaner.enabled: "true"
spark.history.fs.cleaner.interval: "1h"
spark.history.fs.cleaner.maxAge: "12h"
spring.thymeleaf.prefix: classpath:/templates/dev/
spring.thymeleaf.view-names: index,devForm,error
temp.repo.location: x

我正试图使用上面提到的这三个参数清除我在Kubernetes中部署的spark历史服务器日志,我在这里找到了答案清理spark历史日志

当我手动重新启动pod并删除超过12小时的日志时,它是有效的,但随着时间的推移,它再次开始拾取旧日志,spark历史服务器需要1-2小时才能重新启动,有没有其他方法可以做到这一点,这样我就不必随时间手动重新启动pods了。

我四处询问,发现这可能是因为我使用了nfs这样的共享starage。

问题是我试图将这些参数添加到Configmap.yaml文件中,而不是Deployment.yaml文件中。只需在SPARK_HISTORY_OPS中添加这些参数即可。

示例

  • 名称:SPARK_HISTORY_OPS

    值:"-Dspark.history.fs.logDirectory=/fs/YOU/CREATED/ABOVE-Dspark.history.fs.cleaner.enabled=true-Dspark.history.fs.cleaner.interval=1d-Dspart.history.fs.cleaner.maxAge=7d";

这篇文章帮助了我https://wbassler23.medium.com/spark-history-server-on-dc-os-516fb71523a5

最新更新