【Eureka】服务架构类知识点

 

参考《互联网 Java 工程师面试突击(第二季)》第20讲  21min

 

 关于CAP:  Eureka保证AP:

Eureka各个节点是平等的,部分节点挂掉不影响正常节点的工作,剩余节点依然可以提供注册和查询服务。

Eureka客户端在向某个Eureka服务端注册或发现连接失败时,则会自动切换至其它Eureka服务端节点,只要有一个Eureka服务端节点正常,就能保证注册服务可用(保证可用性),只不过查到的信息可能不是最新的(不保证强一致性)。

  

Why is it so Slow to Register a Service?

https://projects.spring.io/spring-cloud/spring-cloud.html#spring-cloud-eureka-server

 Being an instance also involves a periodic heartbeat to the registry (via the client’s serviceUrl) with default duration 30 seconds.

A service is not available for discovery by clients until the instance, the server and the client all have the same metadata in their local cache (so it could take 3 hearbeats).

You can change the period using eureka.instance.leaseRenewalIntervalInSeconds and this will speed up the process of getting clients connected to other services. In production it’s probably better to stick with the default because there are some computations internally in the server that make assumptions about the lease renewal period.

posted @   飞翔在天  阅读(134)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· winform 绘制太阳,地球,月球 运作规律
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 上周热点回顾(3.3-3.9)
点击右上角即可分享
微信分享提示