【发布时间】:2016-12-20 02:07:49
【问题描述】:
我想做一些 Akka 多节点测试并在遇到障碍时重新启动一个节点。比如:
runOn(nodeA) {
// do something while both nodes are up and running
enterBarrier("nodeBCrashes")
// do something while I'm the only node up and running
enterBarrier("bothNodesUp")
// do something with both nodes up and running again
}
runOn(nodeB) {
// do something while both nodes are up and running
crash()
enterBarrier("nodeBCrashes")
// do nothing because I'm out
enterBarrier("bothNodesUp")
start()
// do something with both nodes up and running again
}
这不能做到吗,至少需要一种方法能够关闭nodeB并启动另一个nodeC具有相同的akka.remote.netty.tcp.port(这是严格的必要的)。像这样的
runOn(nodeA) {
// do something while both nodes are up and running
enterBarrier("nodeBCrashes")
// do something while I'm the only node up and running
enterBarrier("bothNodesUp")
// do something with both nodes up and running again
}
runOn(nodeB) {
// do something while both nodes are up and running
enterBarrier("nodeBCrashes")
shutdown()
}
// How I can delay nodeC start until nodeA reaches bothNodesUp barrier?
runOn(nodeC) {
// do something when both nodes are up and running
}
问题可以恢复到:
我们能否重现一个节点崩溃然后重启的情况?
- 我们可以重新启动节点吗?
- 如果没有,我们可以在其余节点达到 berrier 时启动一个节点吗?
- 我们能否将相同的 akka.remote.netty.tcp.port 分配给不同的节点(不应并行运行)。我尝试使用 *.opts 文件但没有成功,是这样吗?
【问题讨论】:
标签: akka akka-testkit