Spring cloud Zuul转发错误
我在使用Zuul和Ribbon时遇到问题。我还使用Eureka进行微服务注册Spring cloud Zuul转发错误,spring-cloud,netflix-zuul,spring-cloud-netflix,netflix,netflix-feign,Spring Cloud,Netflix Zuul,Spring Cloud Netflix,Netflix,Netflix Feign,我在使用Zuul和Ribbon时遇到问题。我还使用Eureka进行微服务注册 我有一个功能区服务(端口9000),它使用RESTAPI与用户服务通信 用户服务有2个实例(在端口8081和8091上) 在ribbon服务上,我使用hystrix和Faign client实现了客户端负载平衡 我使用Zuul路由使用ribbon服务API,然后该API触发用户服务API 当我启动我的微服务生态系统并尝试使用ribbon服务API(zuulservice:8761/ribbon service/)时
- 我有一个功能区服务(端口9000),它使用RESTAPI与用户服务通信
- 用户服务有2个实例(在端口8081和8091上)
- 在ribbon服务上,我使用hystrix和Faign client实现了客户端负载平衡
- 我使用Zuul路由使用ribbon服务API,然后该API触发用户服务API
> #Service port
server.port=8765
#Service port
spring.application.name=zuul-service
# Discovery Server Access
eureka.client.service-url.defaultZone:http://localhost:8761/eureka/
eureka.instance.lease-renewal-interval-in-seconds=3
#User service configuration
zuul.routes.user-service.path:/user-service/**
zuul.routes.user-service.serviceId:user-service
#Product service configuration
zuul.routes.product-service.path:/product-service/**
zuul.routes.product-service.serviceId:product-service
#Product service configuration
zuul.routes.shoppingcart-service.path:/shoppingcart-service/**
zuul.routes.shoppingcart-service.serviceId:shoppingcart-service
#Product service configuration
zuul.routes.payment-service.path:/payment-service/**
zuul.routes.payment-service.serviceId:payment-service
#Product service configuration
zuul.routes.ribbon-service.path:/ribbon-service/**
zuul.routes.ribbon-service.serviceId:ribbon-service
> #Application name
spring.application.name=zuul-service
#hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 12600
ribbon.ConnectTimeout: 6000
ribbon.ReadTimeout: 60000
robbon.eureka.enabled: true
hystrix.command.default.execution.timeout.enabled=false
这是我的zuul服务bootstrap.properties:
> #Service port
server.port=8765
#Service port
spring.application.name=zuul-service
# Discovery Server Access
eureka.client.service-url.defaultZone:http://localhost:8761/eureka/
eureka.instance.lease-renewal-interval-in-seconds=3
#User service configuration
zuul.routes.user-service.path:/user-service/**
zuul.routes.user-service.serviceId:user-service
#Product service configuration
zuul.routes.product-service.path:/product-service/**
zuul.routes.product-service.serviceId:product-service
#Product service configuration
zuul.routes.shoppingcart-service.path:/shoppingcart-service/**
zuul.routes.shoppingcart-service.serviceId:shoppingcart-service
#Product service configuration
zuul.routes.payment-service.path:/payment-service/**
zuul.routes.payment-service.serviceId:payment-service
#Product service configuration
zuul.routes.ribbon-service.path:/ribbon-service/**
zuul.routes.ribbon-service.serviceId:ribbon-service
> #Application name
spring.application.name=zuul-service
#hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds: 12600
ribbon.ConnectTimeout: 6000
ribbon.ReadTimeout: 60000
robbon.eureka.enabled: true
hystrix.command.default.execution.timeout.enabled=false
我正在使用Spring2.0.1和SpringCloudFinchley.RELEASE
有人能解释一下发生了什么事吗
谢谢大家! DiscoveryClient的工作方式是,它从
Eureka
(服务发现)获取每个定义的时间段(称为hearbeat
)的新更改列表。在注册应用程序的新更改从服务发现传播到Zuul实例之前,它肯定会有错误
<>你在日志中看到的输出只是确认它已经收到了这个信息。 你可以考虑为ZUUL配置添加条路径配置。< /P>
在每个路由配置中添加stripPrefix=false听起来好像Zuul还不知道
功能区服务
。在启动Zuul之前,您是否正在启动功能区服务?如果在Zuul之后启动,Zuul从Eureka获取更新信息需要一段时间。它总是在Zuul服务之前启动。如果功能区服务在Zuul之前启动,并且在Zuul启动之前注册,它应该包括在Zuul启动时从Eureka服务器获取的服务列表中在尤里卡注册。我不知道我们还能做什么。你能提供一个重现问题的样本吗?@RyanBaxter谢谢你的努力。我按正确的顺序启动它们,但有时会出现这种错误。直到zuul服务提示this:INFO 19233---[erListUpdater-0]c.netflix.config.ChainedDynamicProperty:Flipping属性:ribbon-service.ribbon.ActiveConnectionsLimit到u,错误才会消失