如何使用检查点更改Spark Streaming应用程序? [英] How to change Spark Streaming application with checkpointing?

查看:79
本文介绍了如何使用检查点更改Spark Streaming应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请考虑以下情况:

  • 通过Spark流创建初始管道
  • 启用检查点
  • 运行应用程序一段时间
  • 停止流应用程序
  • 对管道进行了微小的更改,例如业务逻辑保持不变,但进行了一些重构,重命名,类移动等.
  • 重新启动流式应用程序
  • 获取异常,因为存储在检查点目录中的管道与新的管道在类级别上有所不同

应对这种情况的最佳实践是什么?如何在启用检查点的情况下无缝升级流应用程序?流应用程序版本控制的最佳做法是什么?

What are the best practices to deal with such a scenario? How can we seamlessly upgrade streaming application with checkpointing enabled? What are the best practices for versioning of streaming applications?

推荐答案

tl; dr 检查点用于恢复而不是升级.

tl;dr Checkpointing is for recovery situations not for upgrades.

来自有关Checkpointing的官方文档:

流媒体应用程序必须24/7全天候运行,因此必须能够抵抗与应用程序逻辑无关的故障(例如,系统故障,JVM崩溃等).为此,Spark Streaming需要为容错存储系统检查足够的信息,以便可以从故障中恢复.

A streaming application must operate 24/7 and hence must be resilient to failures unrelated to the application logic (e.g., system failures, JVM crashes, etc.). For this to be possible, Spark Streaming needs to checkpoint enough information to a fault- tolerant storage system such that it can recover from failures.

因此,要回答有关使用检查点(用于容错)和更改应用程序代码的问题,您不应指望它会起作用,因为它违反了设计.

So to answer your question about using checkpointing (that is meant for fault tolerance) and changing your application code, you should not expect it would work since it is against the design.

这篇关于如何使用检查点更改Spark Streaming应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆