idea启动springcloud的注册中心eureka服务报错

下载完整的springcloud项目,直接启动注册发现服务,报错

报错信息

com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server
at com.netflix.discovery.shared.transport.decorator.RetryableEurekaHttpClient.execute(RetryableEurekaHttpClient.java:111) ~[eureka-client-1.6.2.jar:1.6.2]
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56) ~[eureka-client-1.6.2.jar:1.6.2]
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator$1.execute(EurekaHttpClientDecorator.java:59) ~[eureka-client-1.6.2.jar:1.6.2]
at com.netflix.discovery.shared.transport.decorator.SessionedEurekaHttpClient.execute(SessionedEurekaHttpClient.java:77) ~[eureka-client-1.6.2.jar:1.6.2]
at com.netflix.discovery.shared.transport.decorator.EurekaHttpClientDecorator.register(EurekaHttpClientDecorator.java:56) ~[eureka-client-1.6.2.jar:1.6.2]
at com.netflix.discovery.DiscoveryClient.register(DiscoveryClient.java:798) ~[eureka-client-1.6.2.jar:1.6.2]
at com.netflix.discovery.InstanceInfoReplicator.run(InstanceInfoReplicator.java:104) ~[eureka-client-1.6.2.jar:1.6.2]
at com.netflix.discovery.InstanceInfoReplicator 1. r u n ( I n s t a n c e I n f o R e p l i c a t o r . j a v a : 88 ) [ e u r e k a − c l i e n t − 1.6.2. j a r : 1.6.2 ] a t j a v a . u t i l . c o n c u r r e n t . E x e c u t o r s 1.run(InstanceInfoReplicator.java:88) [eureka-client-1.6.2.jar:1.6.2] at java.util.concurrent.Executors 1.run(InstanceInfoReplicator.java:88)[eurekaclient1.6.2.jar:1.6.2]atjava.util.concurrent.ExecutorsRunnableAdapter.call(Executors.java:511) [na:1.8.0_202]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_202]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access 201 ( S c h e d u l e d T h r e a d P o o l E x e c u t o r . j a v a : 180 ) [ n a : 1.8. 0 2 02 ] a t j a v a . u t i l . c o n c u r r e n t . S c h e d u l e d T h r e a d P o o l E x e c u t o r 201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_202] at java.util.concurrent.ScheduledThreadPoolExecutor 201(ScheduledThreadPoolExecutor.java:180)[na:1.8.0202]atjava.util.concurrent.ScheduledThreadPoolExecutorScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_202]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_202]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_202]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_202]

在这里插入图片描述

原因

application配置了两个环境的文件,但是idea启动时却没有指定(ps:这里本来是不需要两个文件的)。
在这里插入图片描述

解决方法

指定环境——在idea启动器上指定active-profile或直接在yml中配
idea指定环境配置文件:
在这里插入图片描述
点击Edit-Configuration
在这里插入图片描述点击ok,再运行即可

yml指定环境配置文件:
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值