且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

同一应用程序中的配置服务器和尤里卡服务器:尝试连接到 localhost:8761

更新时间:2023-11-22 21:01:28

你可以尝试像下面那样改变你的配置吗

Could you try to change your configuration like below

eureka:
  client:
    registerWithEureka: false
    fetchRegistry: false
    service-url:
      defaultZone: http://localhost:8888/eureka

您指定 server.port: 8888.所以你的尤里卡在 8888 端口上运行.但是您没有为尤里卡指定任何服务网址.所以我认为你的尤里卡服务器正试图复制到 localhost:8761 因为它是默认的,你没有为尤里卡指定 service-url .

You specify server.port: 8888. So your eureka is running on 8888 port. But you didn't specify any service-url for eureka. So I think that your eureka server is trying to replicate to localhost:8761 because it's default and you didn't specify service-url for eureka.