Configuring the Spring Cloud Eureka server

Our Eureka server needs to be configured using the Spring Cloud Server configured in the previous sections. Then, we need to keep the application.yaml off our project, to use the Config Server properly. Instead of the application.yaml, we need to put the bootstrap.yaml and put the Config Server address on it.

Then, we need to:

  • Create discovery.yaml on GitHub
  • Create bootstrap.yaml file in the classpath project 

Let's start with the discovery.yaml file. The file should look like this:

server:  port: 8761eureka:  instance:    hostname: localhost    health-check-url-path: /actuator/health    status-page-url-path: /actuator/info   client:    registerWithEureka: false    fetchRegistry: falselogging:  level: com.netflix.discovery: ...

Get Spring 5.0 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.