gpt4 book ai didi

apache-storm - 如何在故障转移期间恢复 bolt 状态

转载 作者:行者123 更新时间:2023-12-03 17:51:34 26 4
gpt4 key购买 nike

我试图弄清楚如何在故障转移期间恢复 Storm bolt 实例的状态。我可以在外部(数据库或文件系统)保持状态,但是一旦 Bolt 实例重新启动,我需要指向该 Bolt 实例的特定状态以恢复它。
bolt 的准备方法接收上下文,记录在此处 http://nathanmarz.github.io/storm/doc/backtype/storm/task/TopologyContext.html

我不清楚的是 - 是否有任何上下文可以唯一标识特定的 Bolt 实例,以便我可以了解要指向哪个持久状态?该 ID 在故障转移期间是否保留?或者,是否可以为故障转移期间保留的特定 bolt /实例设置任何变量/对象?任何帮助表示赞赏!

br
同胞

附言
stackoverflow 的新手,所以请耐心等待...

最佳答案

你大概可以找 Trident它基本上是建立在 Storm 之上的抽象。文档说

Trident has first-class abstractions for reading from and writing to stateful sources. The state can either be internal to the topology – e.g., kept in-memory and backed by HDFS – or externally stored in a database like Memcached or Cassandra



如果出现任何故障,它会说

Trident manages state in a fault-tolerant way so that state updates are idempotent in the face of retries and failures.



您可以查看文档以获得任何进一步的说明。

关于apache-storm - 如何在故障转移期间恢复 bolt 状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20189628/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com