欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

SpringCloud错误:Illegal character in path at index 29: http://localhost:7000/eureka/ /

程序员文章站 2024-02-14 17:06:34
...

错误原因:将服务注册到Eureka中心时,配置文件中写法,在两个Eureka地址之间加了空格,导致报错URL中含有不合法的字符

错误写法:

# 注册到Eureka中
eureka:
  instance:
    instance-id: springcloud-zuul-config-5001
  client:
    service-url:
      defaultZone: http://localhost:7000/eureka/ , http://feiyu:7001/eureka/

正确写法:

# 注册到Eureka中
eureka:
  instance:
    instance-id: springcloud-zuul-config-5001
  client:
    service-url:
      defaultZone: http://localhost:7000/eureka/,http://feiyu:7001/eureka/