0

Currently I'm working in Spring boot micro services project. Consider I have 3 micro services named as A, B, C. Now My project have application.yml file separately for each micro service. Now I want to add one more microservice D, for manage all service property files.

view my config-service structure

enter image description here

eureka.yml(inside config-service) file is:

server: 
  port: 8761
eureka: 
  client:
    registerWithEureka: false
    fetchRegistry: false
  server:
    waitTimeInMsWhenSyncEmpty: 0
endpoints:
  sensitive: false

In eureka-service bootstrap.properties is:

spring:
  application:
    name: eureka
  cloud: 
    config:
      uri: http://localhost:8888

Config service application properties :

spring:
  application: 
    name: config 
  cloud: 
    config: 
      server:
        native:
          search-locations: classpath:/config/DEVELOP
  profiles:
     active: native

server:
  port: 8888

my config application file is:

@SpringBootApplication
@EnableConfigServer
public class ConfigApplication {

    public static void main(String[] args) {
        SpringApplication.run(ConfigApplication.class, args);
    }
}

I did the following steps:

  1. start the config-service
  2. start the eureka-service

unfortunately, eureka server getting error.

com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server

the problem is while running eureka server, its not looking the config file which is inside the config service...

help me to resolve this. or instead of micro service, how can I go with folder?

Meg
  • 109
  • 2
  • 2
  • 12
  • Are you sure Eureka is fetching its properties from the config service? Normally you should see something like this in your logs (right below the banner): `[ConfigServicePropertySourceLocator.java:80] - Fetching config from server at: http://localhost:8888`. Additionally to that, make sure that your configuration is actually available. You can check what config you'll get in Eureka by visiting: http://localhost:8888/eureka. – g00glen00b Oct 19 '17 at 13:15

1 Answers1

0

Thanks @ g00glen00b

I am changed config service bootstrap yml as follows :

 spring:
  application: 
    name: config 
  cloud:
    config: 
      server:
        native: 
          searchLocations: classpath:/config/DEVELOP/
  profiles:
     active: native

server:
  port: 8888

Its working fine.

Meg
  • 109
  • 2
  • 2
  • 12