首页 文章

Spring Cloud Discrovery Eureka - 返回Localhost而不是它所在的主机名

提问于
浏览
0

我正在使用Spring Cloud Eureka Server和Config Server作为Discovery First,我的问题是:

当它在eureka服务器中自带的服务注册表时,它返回的配置服务器URL是 http://}:8888http://LOCALHOST:8888 ,并且在其他服务器中托管的所有其他服务都无法找到其配置 .

日志行:

从服务器获取配置:http:// localhost:8888

我可以做任何配置来解决它吗?

配置服务器的application.yml是这样的:

server:
  port: 8888

spring:
  application:
    name: configserver
  profiles:
    active: native
  cloud:
    config:
      server:
        native:
          searchLocations: /opt/config_dir

eureka:
  client:
    serviceUrl:
      defaultZone: http://10.111.22.33:8761/eureka,http://10.111.33.44:8761/eureka

配置客户端bootstrap.yml是这样的:

spring:
  application:
    name: show-service
  profiles:
    active: dev
  cloud:
    discovery:
      enabled: true

eureka:
  client:
    serviceUrl:
      defaultZone: http://10.111.22.33:8761/eureka,http://10.111.33.44:8761/eureka

1 回答

相关问题