SparkStringApplication进行升级时保证零丢失
来源:互联网 发布:自建邮件服务器 linux 编辑:程序博客网 时间:2024/06/06 11:40
升级SparkStreaming Application代码
StreamingContext.stop(...)
or JavaStreamingContext.stop(...)
for graceful shutdown options) 此时可以采用检查某一标识进行程序的有条件性stop,比如设置数据库中某一字段进行标识,或者是在hdfs上设置一个标记文件 marker file,在程序中启动一个后台线程每隔一小时查询一次标识(或者自定义事件),根据标识进行条件性终止程序。这种方式相比第一种方式可以很方便的实现,无需改动太多的逻辑。注意点:更改新的checkpoint目录,否则导致序列化等错误。
Either your application will start but will run the old version of the application (without letting you know!)
Or you will get deserialization errors and your application will not start at all.
Upgrading Application Code
If a running Spark Streaming application needs to be upgraded with new application code, then there are two possible mechanisms.
The upgraded Spark Streaming application is started and run in parallel to the existing application. Once the new one (receiving the same data as the old one) has been warmed up and is ready for prime time, the old one be can be brought down. Note that this can be done for data sources that support sending the data to two destinations (i.e., the earlier and upgraded applications).
The existing application is shutdown gracefully (see
StreamingContext.stop(...)
orJavaStreamingContext.stop(...)
for graceful shutdown options) which ensure data that has been received is completely processed before shutdown. Then the upgraded application can be started, which will start processing from the same point where the earlier application left off. Note that this can be done only with input sources that support source-side buffering (like Kafka, and Flume) as data needs to be buffered while the previous application was down and the upgraded application is not yet up. And restarting from earlier checkpoint information of pre-upgrade code cannot be done. The checkpoint information essentially contains serialized Scala/Java/Python objects and trying to deserialize objects with new, modified classes may lead to errors. In this case, either start the upgraded app with a different checkpoint directory, or delete the previous checkpoint directory.
- SparkStringApplication进行升级时保证零丢失
- Spark Streaming使用Kafka保证数据零丢失
- Spark Streaming使用Kafka保证数据零丢失
- Spark Streaming和Kafka整合保证数据零丢失
- Spark Streaming使用Kafka保证数据零丢失
- Spark Streaming使用Kafka保证数据零丢失
- Spark Streaming使用Kafka保证数据零丢失
- 【总结】Spark Streaming和Kafka整合保证数据零丢失
- Spark Streaming和Kafka整合是如何保证数据零丢失
- Kafka消息保证不丢失
- 阿里云服务器升级导致挂载硬盘丢失进行重新挂载
- Twitter Storm如何保证消息不丢失
- Twitter Storm如何保证消息不丢失
- Twitter Storm如何保证消息不丢失
- Twitter Storm如何保证消息不丢失
- Twitter Storm如何保证消息不丢失
- Twitter Storm如何保证消息不丢失
- storm的tuple不丢失保证
- linux内核死机2-smp
- 人工智能与计算机视觉
- 关于EJB的解析
- phpstorm配置ftp,自动更新代码
- 成为Java高手的25个学习要点
- SparkStringApplication进行升级时保证零丢失
- DLL EXE查看工具 Dumpbin.exe
- 第一天
- uva 10047 The Monocycle (bfs||思维数组标记状态)
- 使用@Aspect不起作用
- 洛谷 P1051 谁拿了最多奖学金
- JS call bind apply
- 变步长梯形法
- SpringMVC 异常处理