Closed SixPenny closed 6 years ago
Can you provide a sample that reproduces the problem?
I generate my project using jhipster. Registry was downloaded. I uploaded all of it on https://github.com/SixPenny/SpringCloud.git under project folder. You can start registry with profile dev,peer1 and dev,peer2(run JHipsterRegistry twice, only one seems problem). Then start up service project, it'll report propertysource error. If you start ConfigServer project(removed @EnableEurekaServer annotation, the same with registry project) before service project, it starts fine.
You need to change the root of the config server since, by default it would take over the paths expected by eureka server.
On the server spring.cloud.config.server.prefix=/myprefix
and spring.cloud.config.uri=http://<configserverhostport/myprefix
on the client.
@spencergibb I did this in my project. I use the property spring.cloud.config.uri
with prefix config now. Eureka also has eureka prefix. It works fine. But when I delete this and change to spring.cloud.config.discovery
, it said 'cannot location config server'
.
@SixPenny You can fix this problem by setting eureka.instance.metadata-map.configPath={spring.cloud.config.server.prefix}
on the config server, thus all the config clients can know that prefix via service discovery and reach the config server endpoints with it. See
discovery-first-bootstrap
Could you please tell clearly how do we Connect to Config Service from Config client via Eureka ?
this is the bootsrap.ym. file,
spring: application: name : mtx-buyer cloud: config: discovery: enabled: true serviceId : mtx-config-server failfast: true retry: maxAttempts: 100 initialInterval: 2000 maxInterval: 3000 multiplier: 1.5
eureka: client: register-with-eureka: true fetch-registry: false serviceUrl: defaultZone: http://172.17.0.1:1112/eureka/ healthcheck: enabled: true
logging: level: org.springframework.web: 'DEBUG'
Please see our documentation http://cloud.spring.io/spring-cloud-static/Finchley.RELEASE
Please learn how to properly format the code
Hi there ,I combined eureka \@EnableEurekaServer and config server \@EnableConfigServer in one class.I also add \@EnableDiscoveryClient annotation on it.But on the register page ,only registry is shown registered,without config-server.When I use config.discovery.enabled=true in client side,an error occurred that 'could not locate PropertySource and the fail fast property is set,failing'.Is there a method to handle this without split eureke and config server?
part of server application.yml
part of client bootstrap.yml
ps:when I use spring.cloud.config.uri not discovery property ,it can locate config server.