Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/spring-boot/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot 如何使用Eureka服务器将配置客户端连接到配置服务器?_Spring Boot_Spring Cloud_Spring Cloud Config_Spring Cloud Netflix_Spring Boot Configuration - Fatal编程技术网

Spring boot 如何使用Eureka服务器将配置客户端连接到配置服务器?

Spring boot 如何使用Eureka服务器将配置客户端连接到配置服务器?,spring-boot,spring-cloud,spring-cloud-config,spring-cloud-netflix,spring-boot-configuration,Spring Boot,Spring Cloud,Spring Cloud Config,Spring Cloud Netflix,Spring Boot Configuration,我有一个场景,每当我们使用config server和config client时,我们都需要将bootstrap.yaml放入其中。假设我的配置服务器位于端口9001上,因此我需要在属性文件http://localhost:9001:/ 我的问题是,“可以使用eureka server将配置客户端连接到配置服务器,这样我们就可以删除核心属性”这些是我用来解决问题的属性 尤里卡地产 spring.application.name=discovery-server eureka.client.re

我有一个场景,每当我们使用config serverconfig client时,我们都需要将bootstrap.yaml放入其中。假设我的配置服务器位于端口9001上,因此我需要在属性文件http://localhost:9001:/


我的问题是,“可以使用eureka server配置客户端连接到配置服务器,这样我们就可以删除核心属性”

这些是我用来解决问题的属性

尤里卡地产

spring.application.name=discovery-server
eureka.client.registerWithEureka = true
eureka.client.fetchRegistry = false
server.port = 9050
eureka.client.serviceUrl.defaultZone=http://localhost:9050/eureka/
spring:
  application:
    name: configserver
  cloud:
    config:
      server:
        git:
          uri: git-url
          username: git-username
          password: git-password
      fail-fast: true
    
server:
  port: 8080
    
eureka:
   client:
      serviceUrl:
         defaultZone: http://localhost:9050/eureka
spring:
  application:
    name: x
  cloud:
    config:
      profile: dev
      fail-fast: true
      discovery:
        enabled: true
        service-id: CONFIGSERVER
      retry:
        initial-interval: 2000
        multiplier: 1.5
        max-interval: 60000
        max-attempts: 100
        
server:
  port: 8081

eureka:
   client:
      serviceUrl:
         defaultZone: http://localhost:9050/eureka
      fetch-registry: true
   instance:
    lease-renewal-interval-in-seconds: 10
配置服务器属性

spring.application.name=discovery-server
eureka.client.registerWithEureka = true
eureka.client.fetchRegistry = false
server.port = 9050
eureka.client.serviceUrl.defaultZone=http://localhost:9050/eureka/
spring:
  application:
    name: configserver
  cloud:
    config:
      server:
        git:
          uri: git-url
          username: git-username
          password: git-password
      fail-fast: true
    
server:
  port: 8080
    
eureka:
   client:
      serviceUrl:
         defaultZone: http://localhost:9050/eureka
spring:
  application:
    name: x
  cloud:
    config:
      profile: dev
      fail-fast: true
      discovery:
        enabled: true
        service-id: CONFIGSERVER
      retry:
        initial-interval: 2000
        multiplier: 1.5
        max-interval: 60000
        max-attempts: 100
        
server:
  port: 8081

eureka:
   client:
      serviceUrl:
         defaultZone: http://localhost:9050/eureka
      fetch-registry: true
   instance:
    lease-renewal-interval-in-seconds: 10
配置客户端属性

spring.application.name=discovery-server
eureka.client.registerWithEureka = true
eureka.client.fetchRegistry = false
server.port = 9050
eureka.client.serviceUrl.defaultZone=http://localhost:9050/eureka/
spring:
  application:
    name: configserver
  cloud:
    config:
      server:
        git:
          uri: git-url
          username: git-username
          password: git-password
      fail-fast: true
    
server:
  port: 8080
    
eureka:
   client:
      serviceUrl:
         defaultZone: http://localhost:9050/eureka
spring:
  application:
    name: x
  cloud:
    config:
      profile: dev
      fail-fast: true
      discovery:
        enabled: true
        service-id: CONFIGSERVER
      retry:
        initial-interval: 2000
        multiplier: 1.5
        max-interval: 60000
        max-attempts: 100
        
server:
  port: 8081

eureka:
   client:
      serviceUrl:
         defaultZone: http://localhost:9050/eureka
      fetch-registry: true
   instance:
    lease-renewal-interval-in-seconds: 10

这些是我用来解决问题的属性

尤里卡地产

spring.application.name=discovery-server
eureka.client.registerWithEureka = true
eureka.client.fetchRegistry = false
server.port = 9050
eureka.client.serviceUrl.defaultZone=http://localhost:9050/eureka/
spring:
  application:
    name: configserver
  cloud:
    config:
      server:
        git:
          uri: git-url
          username: git-username
          password: git-password
      fail-fast: true
    
server:
  port: 8080
    
eureka:
   client:
      serviceUrl:
         defaultZone: http://localhost:9050/eureka
spring:
  application:
    name: x
  cloud:
    config:
      profile: dev
      fail-fast: true
      discovery:
        enabled: true
        service-id: CONFIGSERVER
      retry:
        initial-interval: 2000
        multiplier: 1.5
        max-interval: 60000
        max-attempts: 100
        
server:
  port: 8081

eureka:
   client:
      serviceUrl:
         defaultZone: http://localhost:9050/eureka
      fetch-registry: true
   instance:
    lease-renewal-interval-in-seconds: 10
配置服务器属性

spring.application.name=discovery-server
eureka.client.registerWithEureka = true
eureka.client.fetchRegistry = false
server.port = 9050
eureka.client.serviceUrl.defaultZone=http://localhost:9050/eureka/
spring:
  application:
    name: configserver
  cloud:
    config:
      server:
        git:
          uri: git-url
          username: git-username
          password: git-password
      fail-fast: true
    
server:
  port: 8080
    
eureka:
   client:
      serviceUrl:
         defaultZone: http://localhost:9050/eureka
spring:
  application:
    name: x
  cloud:
    config:
      profile: dev
      fail-fast: true
      discovery:
        enabled: true
        service-id: CONFIGSERVER
      retry:
        initial-interval: 2000
        multiplier: 1.5
        max-interval: 60000
        max-attempts: 100
        
server:
  port: 8081

eureka:
   client:
      serviceUrl:
         defaultZone: http://localhost:9050/eureka
      fetch-registry: true
   instance:
    lease-renewal-interval-in-seconds: 10
配置客户端属性

spring.application.name=discovery-server
eureka.client.registerWithEureka = true
eureka.client.fetchRegistry = false
server.port = 9050
eureka.client.serviceUrl.defaultZone=http://localhost:9050/eureka/
spring:
  application:
    name: configserver
  cloud:
    config:
      server:
        git:
          uri: git-url
          username: git-username
          password: git-password
      fail-fast: true
    
server:
  port: 8080
    
eureka:
   client:
      serviceUrl:
         defaultZone: http://localhost:9050/eureka
spring:
  application:
    name: x
  cloud:
    config:
      profile: dev
      fail-fast: true
      discovery:
        enabled: true
        service-id: CONFIGSERVER
      retry:
        initial-interval: 2000
        multiplier: 1.5
        max-interval: 60000
        max-attempts: 100
        
server:
  port: 8081

eureka:
   client:
      serviceUrl:
         defaultZone: http://localhost:9050/eureka
      fetch-registry: true
   instance:
    lease-renewal-interval-in-seconds: 10

是的,看,我读了文档。你有工作示例吗?请分享。谢谢快速谷歌搜索给我是的,看我读的文件你有任何工作的例子请分享。感谢谷歌快速搜索给我的帮助