spring-boot - “com.netflix.client.ClientException:负载均衡器没有可用于客户端的服务器:外汇服务”
问题描述
我是微服务的新手,只是想创建两个微服务并将它们注册到尤里卡。我收到以下异常:
"com.netflix.client.ClientException: Load balancer does not have available server for client: forex-service". Below is my configuration.
尤里卡命名服务器类:
@SpringBootApplication
@EnableEurekaServer
public class MicroserviceEurekaNamingServerApplication {}
应用程序属性
spring.application.name=netflix-eureka-naming-server
server.port=8761
eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false
外汇服务等级:
@SpringBootApplication
@EnableDiscoveryClient
@EnableEurekaClient
public class Forex2Microservice2Application {}
应用程序属性
spring.application.name=forex-service
spring.jpa.show-sql=true
spring.h2.console.enabled=true
eureka.client.service-url.default-zone=http://localhost:8761/eureka
货币服务类:
@SpringBootApplication
@EnableFeignClients
@EnableDiscoveryClient
@EnableEurekaClient
public class SpringBootMicroserviceCurrencyConversionApplication {}
应用程序属性
spring.application.name=currency-conversion-service
server.port=8100
eureka.client.service-url.default-zone=http://localhost:8761/eureka
假装客户端
@FeignClient(name = "forex-service")
@RibbonClient(name = "forex-service")
public interface CurrencyExchangeServiceProxy {}
提前致谢。
解决方案
推荐阅读
- mysql - MYSQL:我有两张表。我想在表 1 中使用 FK 显示表 1 和表 2 中的数据
- flutter - Flutter - 函数 - 返回数组
- python-3.x - Scrapy请求回调不进入下一个函数
- spring - 使用 @Conditional 注入请求范围和原型 bean
- vue.js - 如何获取值 altLanguages 并将其动态放入 JSON 中,以便可以将其加载到 Head 中
- java - 如何在 Eclipse 中使用 Gradle 运行 cucumber + springboot 应用程序
- python - 追加只是追加最后一行
- r - 为什么我不能从 R markdown 中的链接下载?
- python - 使用 Python 在 MySQL 上执行 upsert 操作
- r - R中传单中聚类标记的聚合加权线串