O'Reilly logo

Mastering Spring Cloud by Piotr Minkowski

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building the example application

For the Eureka Server, all of the required changes may be defined in configuration properties. In the application.yml file, I defined three different profiles for each instance of the discovery service. Now, if you try to run Eureka Server embedded in the Spring Boot application, you need to activate the specific profile by providing the VM argument -Dspring.profiles.active=peer[n], where [n] is the instance sequence number:

spring: profiles: peer1eureka: instance:   hostname: peer1   metadataMap:     zone: zone1 client:   serviceUrl:     defaultZone: http://localhost:8762/eureka/,http://localhost:8763/eureka/server:  port: ${PORT:8761}---spring: profiles: peer2eureka: instance:   hostname: peer2   metadataMap: zone: zone2 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required