Spring Cloud Eureka:改变心跳和发现路径

时间:2015-07-23 17:24:54

标签: java spring spring-boot spring-cloud netflix-eureka

我无法想象一个属性来改变位于github中的ConfigBeans的Eureka服务器的心跳和发现上下文:https://github.com/spring-cloud/spring-cloud-netflix/tree/master/spring-cloud-netflix-core/src/main/java/org/springframework/cloud/netflix/eureka

似乎我能够在客户端内设置上下文路径,但不能在服务器上设置。例如,将客户端配置为:

eureka:
  instance:
    statusPageUrlPath: /admin/info
    healthCheckUrlPath: /admin/health
    homePageUrlPath: /admin/dashboard
  client:
    registerWithEureka: false
    fetchRegistry: false
    eurekaServerUrlContext: /admin
    serviceUrl:
      defaultZone: http://localhost:8761/admin/eureka/
  server:
    waitTimeInMsWhenSyncEmpty: 0
  dashboard:
     path: /admin/dashboard 

EurekaServerConfigBean中似乎没有任何内容可供我在服务器上修改以将上下文更改为/admin。当我经营我的客户时,我得到:

2015-07-23 12:18:32.069 ERROR 18894 --- [pool-7-thread-1] com.netflix.discovery.DiscoveryClient    : Can't get a response from http://localhost:8761/admin/eureka/apps/
Can't contact any eureka nodes - possibly a security group issue?

1 个答案:

答案 0 :(得分:2)

所以@spencergibb让我进入了一个测试,它需要Eureka Server application.yml中的以下配置:

server.contextPath: /admin

就是这样做的。我在想,这是一个eureka.server设置。