springcloud 对等体之间的网络中断期间会发生什么?

网络中断的对等体之间会发生什么?可能发生的情况:

The heartbeat replications between peers may fail and the server detects this situation and enters into a self-preservation mode protecting the current state.

对等体之间心跳响应失败后,服务器进入自我存留模式保护当前状态(主动关闭唯一的clien时会发生这种情况)

Registrations may happen in an orphaned server and some clients may reflect new registrations while the others may not.

注册可能发生在孤立的服务器中,一些客户可能会反映新的注册,而其他客户可能不会

The situation autocorrects itself after the network connectivity is restored to a stable state. When the peers are able to communicate fine, the registration information is automatically transferred to the servers that do not have them

在网络连接恢复到稳定状态后,情况会自动更新。当对等方能够正常通信时,注册信息将自动传输到没有它们的服务器


最重要的是,在网络中断期间,服务器尽可能地具有弹性,但是在此期间客户端可能具有不同的服务器视图。


自我保护模式的解决办法:

stackoverflow上,有人给出的建议是: 
1、在生产上可以开自注册,部署两个server 
2、在本机器上测试的时候,可以把比值调低,比如0.49 
3、或者简单粗暴把自我保护模式关闭

eureka.server.enableSelfPreservation=false

猜你喜欢

转载自blog.csdn.net/aa1358075776/article/details/80949821