Eureka服务启动定期报错:Batch update failure with HTTP status code 404; discarding XXX replication tasks
今天新建一个Eureka Server并启动时,Eureka控制台中可以看到已经注册的服务。
但是IDEA控制台一直报错Batch update failure with HTTP status code 404; discarding 3 replication tasks
异常如下:
然后也查了很多博客,最后发现我的问题是因为eureka.instance.hostname
主机名与eureka.client.service-url
地址中的名称不一致导致。
解决方法:eureka.instance.hostname
与eureka.client.service-url
中的服务名一致即可解决。
server:
port: 89
eureka:
instance:
hostname: eurekaserver
client:
fetch-registry: false
register-with-eureka: false
service-url:
defaultZone: http://eurekaserver:89
可能还有其他原因会导致该问题,欢迎各位同学评论区交流学习!