1. Create a Maven project

1. Create projects

2. Select maven

3. Fill in the project information

4. Configuration maven

2. Right-click the project to add service module (Eureka service)

1. Right-click the project and choose template

2. Create springboot

3. Enter template information

4. Select components

5. Add an @enableeurekaserver annotation to the startup class

package com.ming.eureka; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; /** * Eureka service starts * @author admin */ @springBootApplication @enableEurekaserver public class EurekaApplication {public static void main(String[] args) { SpringApplication.run(EurekaApplication.class, args); }}Copy the code

6. Application. yml Configuration information

Spring: Application: name: eureka-server # eureka: client: Register-with-eureka: false # Whether to register your own information to EurekaServer (default is true); # EurekaServer's address is now its own address. If it is a cluster, it needs to add the address of other servers. DefaultZone: {http://127.0.0.1:$server port} / eurekaCopy the code

7. Start project accesshttp://127.0.0.1:10086