SpringCloud 微服务组件

 

微服务的以下组件:

  • Spring Cloud Config Server
  • Netflix Eureka Naming Server
  • Hystrix Server
  • Netflix ZuulAPI Gateway Server
  • Netflix Ribbon
  • Zipkin Distributed Tracing Server

Spring Cloud Config Server

Spring Cloud Config Server为分布式系统中的外部配置提供了基于HTTP资源的API。我们可以使用注释 @EnableConfigServer 启用Spring Cloud Config Server。

 

Netflix Eureka Naming Server

Netflix Eureka服务器是发现服务器。它为外部提供了REST接口以与其进行通信。出现微服务后,将其自身注册为发现客户端。 Eureka服务器还具有另一个名为 Eureka Client 的软件模块。 Eureka客户端与Eureka服务器进行交互以发现服务。 Eureka客户端还会平衡客户端请求。

 

Hystrix Server

Hystrix服务器充当了容错性强的系统。它用于避免应用程序完全失败。通过使用 断路器机制来实现。如果应用程序正常运行,则电路保持关闭状态。如果应用程序遇到错误,Hystrix服务器将断开电路。 Hystrix服务器停止对呼叫服务的进一步请求。它提供了一个高度健壮的系统。

 

Netflix ZuulAPI Gateway Server

Netflix Zuul服务器是所有客户端请求都通过的网关服务器。它充当客户端的统一接口。它还具有一个内置的负载平衡器,可以加载来自客户端的所有传入请求的余额。

 

Netflix Ribbon

Netflix Ribbon是客户端跨进程通信(IPC)库。它提供了客户端平衡算法。它使用循环负载均衡:

 

  • 负载均衡
  • 容错
  • 多种协议(HTTP,TCP,UDP)
  • 缓存和批处理

 

 

Zipkin Distributed Tracing Server

Zipkin是项目中的一个开源项目。这提供了一种发送,接收和可视化跟踪的机制。

您需要关注的一件事是端口号。

应用 Port
Spring Cloud Config Server 8888
Netflix Eureka Naming Server 8761
Netflix ZuulAPI Gateway Server 8765
Zipkin Distributed Tracing Server 9411

 步骤1 : 使用Spring Initializr https://start.spring.io/步骤2 : 选择Spring Boot版本 2.2.0 M6 或更高版本。不要选择快照版本 ...