偏移量如何保存在保存点中
how offsets kept in savepoint
我们使用 kafka 作为管道的来源。我想将现有状态从生产环境转移到新环境。我的问题是新环境中的偏移量会发生什么?因为我们从生产中获取了保存点并且偏移量保存在保存点中,这是否意味着在新环境中作业将开始使用来自生产中的偏移量来消费消息,或者它实际上会从一个新的消息开始,比如新的消费者?
新作业中的偏移量将从保存点中存储的偏移量开始,前提是您从保存点重新启动新作业,如下所示:
$ bin/flink run -s :savepointPath [:runArgs]
相关文档包括本节关于 Kafka Consumers Start Position Configuration 的最后一段,其中指出
Note that these start position configuration methods do not affect the start position when the job is automatically restored from a failure or manually restored using a savepoint. On restore, the start position of each Kafka partition is determined by the offsets stored in the savepoint or checkpoint ...
以及关于 Resuming from Savepoints 的部分。
我们使用 kafka 作为管道的来源。我想将现有状态从生产环境转移到新环境。我的问题是新环境中的偏移量会发生什么?因为我们从生产中获取了保存点并且偏移量保存在保存点中,这是否意味着在新环境中作业将开始使用来自生产中的偏移量来消费消息,或者它实际上会从一个新的消息开始,比如新的消费者?
新作业中的偏移量将从保存点中存储的偏移量开始,前提是您从保存点重新启动新作业,如下所示:
$ bin/flink run -s :savepointPath [:runArgs]
相关文档包括本节关于 Kafka Consumers Start Position Configuration 的最后一段,其中指出
Note that these start position configuration methods do not affect the start position when the job is automatically restored from a failure or manually restored using a savepoint. On restore, the start position of each Kafka partition is determined by the offsets stored in the savepoint or checkpoint ...
以及关于 Resuming from Savepoints 的部分。