Setting up a Eureka Server

We will use Spring Initializr (http://start.spring.io) to set up a new project for Eureka Server. The following screenshot shows the GroupId, ArtifactId, and Dependencies to be selected:

The next step is to add the EnableEurekaServer annotation to the SpringBootApplication class. The following snippet shows the details:

    @SpringBootApplication
@EnableEurekaServer
public class EurekaServerApplication {

The following snippet shows the configuration in application.properties:

    server.port = 8761
eureka.client.registerWithEureka=false
eureka.client.fetchRegistry=false

We are using port 8761 for Eureka Naming Server. Launch EurekaServerApplication.

A screenshot of the Eureka dashboard at http://localhost:8761 is shown here:

As of now, there are no applications registered with Eureka. In the next step, let's register Microservice A and other services with Eureka.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset