如何使用检查点更改 Spark Streaming 应用程序?
How to change Spark Streaming application with checkpointing?
请考虑以下场景:
- 通过 Spark 流创建了初始管道
- 启用检查点
- 运行申请一段时间
- 停止流式应用程序
- 对管道进行了微小的更改,例如业务逻辑保持不变,但进行了一些重构、重命名、class 移动等
- 重新启动流媒体应用程序
- 获取异常,因为存储在检查点目录中的管道与新管道 class 级别不同
处理这种情况的最佳做法是什么?我们如何在启用检查点的情况下无缝升级流应用程序?流式应用程序版本控制的最佳做法是什么?
tl;dr 检查点用于恢复情况而不是升级。
来自official documentation about Checkpointing:
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.
因此,要回答有关使用检查点(用于容错)和更改应用程序代码的问题,您不应期望它会起作用,因为它违反了设计。
请考虑以下场景:
- 通过 Spark 流创建了初始管道
- 启用检查点
- 运行申请一段时间
- 停止流式应用程序
- 对管道进行了微小的更改,例如业务逻辑保持不变,但进行了一些重构、重命名、class 移动等
- 重新启动流媒体应用程序
- 获取异常,因为存储在检查点目录中的管道与新管道 class 级别不同
处理这种情况的最佳做法是什么?我们如何在启用检查点的情况下无缝升级流应用程序?流式应用程序版本控制的最佳做法是什么?
tl;dr 检查点用于恢复情况而不是升级。
来自official documentation about Checkpointing:
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.
因此,要回答有关使用检查点(用于容错)和更改应用程序代码的问题,您不应期望它会起作用,因为它违反了设计。